From d5a19a32d37149b25180d46f4d9a805c121703f8 Mon Sep 17 00:00:00 2001 From: WinUser01 Date: Sat, 23 Apr 2022 22:21:37 +0800 Subject: [PATCH] =?UTF-8?q?hyzp=5Fybqx-Commit130=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E6=9B=B4=E6=94=B9=E5=AE=9A=E6=97=B6=E9=97=B4=E9=9A=94?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/release/output.json | 2 +- lib/pages/tabs/page7_setRemind.dart | 47 +++++++++++++++-------------- pubspec.lock | 7 +++++ 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/android/app/release/output.json b/android/app/release/output.json index 72fe9e2..d9e9228 100644 --- a/android/app/release/output.json +++ b/android/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":20220408,"versionName":"1.4.23","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":20220426,"versionName":"1.4.26","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/lib/pages/tabs/page7_setRemind.dart b/lib/pages/tabs/page7_setRemind.dart index 7763da5..bc590d9 100644 --- a/lib/pages/tabs/page7_setRemind.dart +++ b/lib/pages/tabs/page7_setRemind.dart @@ -38,7 +38,8 @@ class _LoginPageState extends State { //////// static onNullFun() {} - Widget _getListTile(title, { + Widget _getListTile( + title, { String leadPath = '', Color leadColor, Color textColor, @@ -54,20 +55,20 @@ class _LoginPageState extends State { 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 { 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 { 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 { 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 { 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(); } diff --git a/pubspec.lock b/pubspec.lock index 950c571..b112995 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -8,6 +8,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" + android_power_manager: + dependency: "direct main" + description: + name: android_power_manager + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.6" app_installer: dependency: "direct main" description: