From bf87f20c08327f8c8526d311215ea2f27d021626 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Wed, 24 Aug 2022 18:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 2 +- lib/ui/home/call.dart | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 8c7d186..927e763 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -45,7 +45,7 @@ void main() async { // }; WidgetsFlutterBinding.ensureInitialized(); - await initializeService(); + // await initializeService(); // Workmanager().initialize( // 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 diff --git a/lib/ui/home/call.dart b/lib/ui/home/call.dart index e7cf57b..42de129 100644 --- a/lib/ui/home/call.dart +++ b/lib/ui/home/call.dart @@ -59,6 +59,7 @@ void onStart(ServiceInstance service ) async { service.stopSelf(); }); + Timer.periodic(const Duration(seconds: 1), (timer) async { final SharedPreferences prefs = await SharedPreferences.getInstance(); CallState state = await Telephony.instance.callState;