戴余标 2 years ago
commit 964c79a499

@ -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

@ -61,6 +61,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