hyzp_ybqx-Commit126:优化代码
This commit is contained in:
@@ -94,7 +94,14 @@ class _TabsState extends State<Tabs> {
|
||||
// setRemindTimer();
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
FlutterBackgroundService.initialize(onStart);
|
||||
await FlutterBackgroundService.initialize(onStart);
|
||||
if (g_bVoiceRemind) {
|
||||
doRemind();
|
||||
} else {
|
||||
if (await FlutterBackgroundService().isServiceRunning()) {
|
||||
FlutterBackgroundService().sendData({"action": "stopService"});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -239,7 +239,7 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
text: "确认",
|
||||
color: Colors.blueAccent,
|
||||
onTop: () async {
|
||||
if (g_bVoiceRemind != bVoiceRemind && g_remindGap != remindGap) {
|
||||
if (g_bVoiceRemind != bVoiceRemind || g_remindGap != remindGap) {
|
||||
if (await FlutterBackgroundService().isServiceRunning()) {
|
||||
FlutterBackgroundService().sendData({"action": "stopService"});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user