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