|
|
|
|
@ -38,7 +38,8 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
////////
|
|
|
|
|
static onNullFun() {}
|
|
|
|
|
|
|
|
|
|
Widget _getListTile(title, {
|
|
|
|
|
Widget _getListTile(
|
|
|
|
|
title, {
|
|
|
|
|
String leadPath = '',
|
|
|
|
|
Color leadColor,
|
|
|
|
|
Color textColor,
|
|
|
|
|
@ -54,20 +55,20 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: bBadge
|
|
|
|
|
? Badge(
|
|
|
|
|
position: BadgePosition.topEnd(top: -7, end: -12),
|
|
|
|
|
badgeContent: null,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
leadPath,
|
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
|
// color: leadColor, // 无效
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
position: BadgePosition.topEnd(top: -7, end: -12),
|
|
|
|
|
badgeContent: null,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
leadPath,
|
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
|
// color: leadColor, // 无效
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Image.asset(
|
|
|
|
|
leadPath,
|
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
|
),
|
|
|
|
|
leadPath,
|
|
|
|
|
height: ScreenUtil().setHeight(78),
|
|
|
|
|
fit: BoxFit.fitHeight,
|
|
|
|
|
),
|
|
|
|
|
title: Text(title, style: TextStyle(fontSize: size, color: textColor)),
|
|
|
|
|
trailing: trailWidget,
|
|
|
|
|
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0),
|
|
|
|
|
@ -121,9 +122,7 @@ 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(
|
|
|
|
|
@ -136,7 +135,10 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.lightBlue)),
|
|
|
|
|
),
|
|
|
|
|
onChanged: (v) {
|
|
|
|
|
remindGap = int.parse(v);
|
|
|
|
|
int n = int.parse(v);
|
|
|
|
|
if (n > 10 && n < 36000) {
|
|
|
|
|
remindGap = int.parse(v);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -240,6 +242,7 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
text: "确认",
|
|
|
|
|
color: Colors.blueAccent,
|
|
|
|
|
onTop: () async {
|
|
|
|
|
print("g_remindGap = $g_remindGap, remindGap = $remindGap");
|
|
|
|
|
if (g_bVoiceRemind != bVoiceRemind || g_remindGap != remindGap) {
|
|
|
|
|
var isRuning = await FlutterBackgroundService().isServiceRunning();
|
|
|
|
|
print("isRuning = $isRuning");
|
|
|
|
|
@ -256,11 +259,11 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
await Storage.setInt('nRemindGap', g_remindGap);
|
|
|
|
|
|
|
|
|
|
if (bVoiceRemind) {
|
|
|
|
|
var isRunning = await FlutterBackgroundService().isServiceRunning();
|
|
|
|
|
if (!isRunning) {
|
|
|
|
|
await FlutterBackgroundService.initialize(onStart);
|
|
|
|
|
Future.delayed(Duration(seconds: 2), (){
|
|
|
|
|
print('延时2s执行');
|
|
|
|
|
FlutterBackgroundService.initialize(onStart);
|
|
|
|
|
doRemind();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
myPlayClick();
|
|
|
|
|
}
|
|
|
|
|
|