|
|
|
|
@ -38,8 +38,7 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
////////
|
|
|
|
|
static onNullFun() {}
|
|
|
|
|
|
|
|
|
|
Widget _getListTile(
|
|
|
|
|
title, {
|
|
|
|
|
Widget _getListTile(title, {
|
|
|
|
|
String leadPath = '',
|
|
|
|
|
Color leadColor,
|
|
|
|
|
Color textColor,
|
|
|
|
|
@ -122,7 +121,9 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
text: remindGap.toString(),
|
|
|
|
|
// 保持光标在最后
|
|
|
|
|
selection: TextSelection.fromPosition(TextPosition(
|
|
|
|
|
affinity: TextAffinity.downstream, offset: remindGap.toString().length)))),
|
|
|
|
|
affinity: TextAffinity.downstream, offset: remindGap
|
|
|
|
|
.toString()
|
|
|
|
|
.length)))),
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
@ -240,7 +241,9 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
color: Colors.blueAccent,
|
|
|
|
|
onTop: () async {
|
|
|
|
|
if (g_bVoiceRemind != bVoiceRemind || g_remindGap != remindGap) {
|
|
|
|
|
if (await FlutterBackgroundService().isServiceRunning()) {
|
|
|
|
|
var isRuning = await FlutterBackgroundService().isServiceRunning();
|
|
|
|
|
print("isRuning = $isRuning");
|
|
|
|
|
if (isRuning) {
|
|
|
|
|
FlutterBackgroundService().sendData({"action": "stopService"});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -253,13 +256,10 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
await Storage.setInt('nRemindGap', g_remindGap);
|
|
|
|
|
|
|
|
|
|
if (bVoiceRemind) {
|
|
|
|
|
while (true) {
|
|
|
|
|
var isRunning = await FlutterBackgroundService().isServiceRunning();
|
|
|
|
|
if (!isRunning) {
|
|
|
|
|
await FlutterBackgroundService.initialize(onStart);
|
|
|
|
|
myPlayVoiceRemind();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
doRemind();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
myPlayClick();
|
|
|
|
|
|