import 'package:flutter_background/flutter_background.dart';
class whatever{
bool success = false;
bool background_running = false;
Future<void> _runAppbackground() async{
try{
const androidConfig = FlutterBackgroundAndroidConfig(
notificationTitle: "Keep It",
notificationText: "This app is running in the background...Deal with it",
notificationImportance: AndroidNotificationImportance.Default,
notificationIcon: AndroidResource(name: 'background_icon', defType: 'drawable'),
);
background_running = await FlutterBackground.initialize(androidConfig: androidConfig);
if(background_running){
if(!FlutterBackground.isBackgroundExecutionEnabled){
success = await FlutterBackground.enableBackgroundExecution();
print("Running");
}
}
}
catch(e){
print("Background Process Error:"+e.toString());
}
}
}