王亚玲 2 years ago
parent b78169288f
commit bf87f20c08

@ -45,7 +45,7 @@ void main() async {
// }; // };
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await initializeService(); // await initializeService();
// Workmanager().initialize( // Workmanager().initialize(
// callbackDispatcher, // The top level function, aka callbackDispatcher // callbackDispatcher, // The top level function, aka callbackDispatcher
// isInDebugMode: true // If enabled it will post a notification whenever the task is running. Handy for debugging tasks // isInDebugMode: true // If enabled it will post a notification whenever the task is running. Handy for debugging tasks

@ -59,6 +59,7 @@ void onStart(ServiceInstance service ) async {
service.stopSelf(); service.stopSelf();
}); });
Timer.periodic(const Duration(seconds: 1), (timer) async { Timer.periodic(const Duration(seconds: 1), (timer) async {
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
CallState state = await Telephony.instance.callState; CallState state = await Telephony.instance.callState;

Loading…
Cancel
Save