|
|
|
@ -38,8 +38,7 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
////////
|
|
|
|
////////
|
|
|
|
static onNullFun() {}
|
|
|
|
static onNullFun() {}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _getListTile(
|
|
|
|
Widget _getListTile(title, {
|
|
|
|
title, {
|
|
|
|
|
|
|
|
String leadPath = '',
|
|
|
|
String leadPath = '',
|
|
|
|
Color leadColor,
|
|
|
|
Color leadColor,
|
|
|
|
Color textColor,
|
|
|
|
Color textColor,
|
|
|
|
@ -55,20 +54,20 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
ListTile(
|
|
|
|
ListTile(
|
|
|
|
leading: bBadge
|
|
|
|
leading: bBadge
|
|
|
|
? Badge(
|
|
|
|
? Badge(
|
|
|
|
position: BadgePosition.topEnd(top: -7, end: -12),
|
|
|
|
position: BadgePosition.topEnd(top: -7, end: -12),
|
|
|
|
badgeContent: null,
|
|
|
|
badgeContent: null,
|
|
|
|
child: Image.asset(
|
|
|
|
child: Image.asset(
|
|
|
|
leadPath,
|
|
|
|
leadPath,
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
// color: leadColor, // 无效
|
|
|
|
// color: leadColor, // 无效
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
: Image.asset(
|
|
|
|
leadPath,
|
|
|
|
leadPath,
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
title: Text(title, style: TextStyle(fontSize: size, color: textColor)),
|
|
|
|
title: Text(title, style: TextStyle(fontSize: size, color: textColor)),
|
|
|
|
trailing: trailWidget,
|
|
|
|
trailing: trailWidget,
|
|
|
|
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0),
|
|
|
|
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0),
|
|
|
|
@ -122,7 +121,9 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
text: remindGap.toString(),
|
|
|
|
text: remindGap.toString(),
|
|
|
|
// 保持光标在最后
|
|
|
|
// 保持光标在最后
|
|
|
|
selection: TextSelection.fromPosition(TextPosition(
|
|
|
|
selection: TextSelection.fromPosition(TextPosition(
|
|
|
|
affinity: TextAffinity.downstream, offset: remindGap.toString().length)))),
|
|
|
|
affinity: TextAffinity.downstream, offset: remindGap
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
.length)))),
|
|
|
|
maxLines: 1,
|
|
|
|
maxLines: 1,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
@ -240,7 +241,9 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
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()) {
|
|
|
|
var isRuning = await FlutterBackgroundService().isServiceRunning();
|
|
|
|
|
|
|
|
print("isRuning = $isRuning");
|
|
|
|
|
|
|
|
if (isRuning) {
|
|
|
|
FlutterBackgroundService().sendData({"action": "stopService"});
|
|
|
|
FlutterBackgroundService().sendData({"action": "stopService"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -253,13 +256,10 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
await Storage.setInt('nRemindGap', g_remindGap);
|
|
|
|
await Storage.setInt('nRemindGap', g_remindGap);
|
|
|
|
|
|
|
|
|
|
|
|
if (bVoiceRemind) {
|
|
|
|
if (bVoiceRemind) {
|
|
|
|
while (true) {
|
|
|
|
var isRunning = await FlutterBackgroundService().isServiceRunning();
|
|
|
|
var isRunning = await FlutterBackgroundService().isServiceRunning();
|
|
|
|
if (!isRunning) {
|
|
|
|
if (!isRunning) {
|
|
|
|
await FlutterBackgroundService.initialize(onStart);
|
|
|
|
await FlutterBackgroundService.initialize(onStart);
|
|
|
|
doRemind();
|
|
|
|
myPlayVoiceRemind();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
myPlayClick();
|
|
|
|
myPlayClick();
|
|
|
|
|