diff --git a/images/icon_main_1024.png b/images/icon_main_1024.png deleted file mode 100755 index e8cdae88..00000000 Binary files a/images/icon_main_1024.png and /dev/null differ diff --git a/images/icon_main_sky_1024.png b/images/icon_main_sky_1024.png new file mode 100755 index 00000000..dd761bc4 Binary files /dev/null and b/images/icon_main_sky_1024.png differ diff --git a/lib/login/login/starLock_login_page.dart b/lib/login/login/starLock_login_page.dart index 671b746f..c34904dd 100755 --- a/lib/login/login/starLock_login_page.dart +++ b/lib/login/login/starLock_login_page.dart @@ -77,7 +77,7 @@ class _StarLockLoginPageState extends State { Container( padding: EdgeInsets.all(10.w), child: Center( - child: Image.asset('images/icon_main_1024.png', + child: Image.asset('images/icon_main_sky_1024.png', width: 110.w, height: 110.w))), SizedBox(height: 50.w), Obx(() => CommonItem( @@ -190,10 +190,11 @@ class _StarLockLoginPageState extends State { color: AppColors.mainColor, fontSize: 20.sp)), onTap: () { - Get.toNamed(Routers.webviewShowPage, arguments: { - 'url': XSConstantMacro.userAgreementURL, - 'title': '用户协议'.tr - }); + Get.toNamed(Routers.webviewShowPage, + arguments: { + 'url': XSConstantMacro.userAgreementURL, + 'title': '用户协议'.tr + }); }, )), WidgetSpan( @@ -205,10 +206,11 @@ class _StarLockLoginPageState extends State { color: AppColors.mainColor, fontSize: 20.sp)), onTap: () { - Get.toNamed(Routers.webviewShowPage, arguments: { - 'url': XSConstantMacro.privacyPolicyURL, - 'title': '隐私政策'.tr - }); + Get.toNamed(Routers.webviewShowPage, + arguments: { + 'url': XSConstantMacro.privacyPolicyURL, + 'title': '隐私政策'.tr + }); }, )), ], diff --git a/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart b/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart index b4f75049..623643ae 100755 --- a/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart +++ b/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; @@ -32,7 +31,8 @@ class FaceDetailLogic extends BaseGetXController { _replySubscription = EventBusManager().eventBus!.on().listen((Reply reply) { // 添加人脸开始(此处用作删除人脸) - if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen.value == true)) { + if ((reply is SenderAddFaceReply) && + (state.ifCurrentScreen.value == true)) { _replyAddFaceBegin(reply); } }); @@ -48,18 +48,21 @@ class FaceDetailLogic extends BaseGetXController { state.sureBtnState.value = 0; cancelBlueConnetctToastTimer(); dismissEasyLoading(); - if(state.isDeletFace.value == true){ + if (state.isDeletFace.value == true) { deletFaceData(); - }else{ + } else { editFaceData(); } break; case 0x06: //无权限 - final List? privateKey = await Storage.getStringList(saveBluePrivateKey); - final List getPrivateKeyList = changeStringListToIntList(privateKey!); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); + final List getPrivateKeyList = + changeStringListToIntList(privateKey!); - final List? signKey = await Storage.getStringList(saveBlueSignKey); + final List? signKey = + await Storage.getStringList(saveBlueSignKey); final List signKeyDataList = changeStringListToIntList(signKey!); final List token = reply.data.sublist(5, 9); @@ -67,25 +70,25 @@ class FaceDetailLogic extends BaseGetXController { Storage.setStringList(saveBlueToken, saveStrList); IoSenderManage.senderAddFaceCommand( - keyID:state.keyId.value.toString(), - userID:await Storage.getUid(), - faceNo:int.parse(state.typeNumber.value), - useCountLimit:0xffff, - operate:state.isDeletFace.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部 - isAdmin:state.isAdministrator.value == true ? 1 : 0, - isForce:state.isStressFace.value == true ? 1 : 0, // 是否是胁迫 - isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环 - weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环 - startDate: int.parse(state.startDate.value)~/1000, - endDate: int.parse(state.endDate.value)~/1000, - startTime:DateTool().dateToHNString(state.startTime.value), - endTime:DateTool().dateToHNString(state.endTime.value), - needAuthor:1, - signKey:signKeyDataList, - privateKey:getPrivateKeyList, - token: token, - isBeforeAddUser: false - ); + keyID: state.keyId.value.toString(), + userID: await Storage.getUid(), + faceNo: int.parse(state.typeNumber.value), + useCountLimit: 0xffff, + operate: state.isDeletFace.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部 + isAdmin: state.isAdministrator.value == true ? 1 : 0, + isForce: state.isStressFace.value == true ? 1 : 0, // 是否是胁迫 + isRound: state.keyType.value == 4 ? 1 : 0, // 是否是循环 + weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber( + state.weekDay.value), // 周循环 + startDate: int.parse(state.startDate.value) ~/ 1000, + endDate: int.parse(state.endDate.value) ~/ 1000, + startTime: DateTool().dateToHNString(state.startTime.value), + endTime: DateTool().dateToHNString(state.endTime.value), + needAuthor: 1, + signKey: signKeyDataList, + privateKey: getPrivateKeyList, + token: token, + isBeforeAddUser: false); break; default: //失败 @@ -108,35 +111,38 @@ class FaceDetailLogic extends BaseGetXController { BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async { if (deviceConnectionState == BluetoothConnectionState.connected) { - final List? privateKey = await Storage.getStringList(saveBluePrivateKey); - final List getPrivateKeyList = changeStringListToIntList(privateKey!); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); + final List getPrivateKeyList = + changeStringListToIntList(privateKey!); final List? token = await Storage.getStringList(saveBlueToken); final List getTokenList = changeStringListToIntList(token!); - final List? signKey = await Storage.getStringList(saveBlueSignKey); + final List? signKey = + await Storage.getStringList(saveBlueSignKey); final List signKeyDataList = changeStringListToIntList(signKey!); IoSenderManage.senderAddFaceCommand( - keyID:state.keyId.value.toString(), - userID:await Storage.getUid(), - faceNo:int.parse(state.typeNumber.value), - useCountLimit:0xffff, - operate:state.isDeletFace.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部 - isAdmin:state.isAdministrator.value == true ? 1 : 0, - isForce:state.isStressFace.value == true ? 1 : 0, // 是否是胁迫 - isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环 - weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环 - startDate: int.parse(state.startDate.value)~/1000, - endDate: int.parse(state.endDate.value)~/1000, - startTime:DateTool().dateToHNString(state.startTime.value), - endTime:DateTool().dateToHNString(state.endTime.value), - needAuthor:1, - signKey:signKeyDataList, - privateKey:getPrivateKeyList, - token: getTokenList, - isBeforeAddUser: false - ); + keyID: state.keyId.value.toString(), + userID: await Storage.getUid(), + faceNo: int.parse(state.typeNumber.value), + useCountLimit: 0xffff, + operate: state.isDeletFace.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部 + isAdmin: state.isAdministrator.value == true ? 1 : 0, + isForce: state.isStressFace.value == true ? 1 : 0, // 是否是胁迫 + isRound: state.keyType.value == 4 ? 1 : 0, // 是否是循环 + weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber( + state.weekDay.value), // 周循环 + startDate: int.parse(state.startDate.value) ~/ 1000, + endDate: int.parse(state.endDate.value) ~/ 1000, + startTime: DateTool().dateToHNString(state.startTime.value), + endTime: DateTool().dateToHNString(state.endTime.value), + needAuthor: 1, + signKey: signKeyDataList, + privateKey: getPrivateKeyList, + token: getTokenList, + isBeforeAddUser: false); } else if (deviceConnectionState == BluetoothConnectionState.disconnected) { dismissEasyLoading(); @@ -170,11 +176,11 @@ class FaceDetailLogic extends BaseGetXController { faceName: state.changeNameController.text, ); if (entity.errorCode!.codeIsSuccessful) { - state.faceItemData.value.fingerprintName = state.changeNameController.text; + state.faceItemData.value.faceName = state.changeNameController.text; showToast('修改成功', something: () { Get.back(result: 'addScuess'); }); - }else{ + } else { Get.back(); } } @@ -210,13 +216,14 @@ class FaceDetailLogic extends BaseGetXController { useDateStr = '永久'.tr; } else if (state.keyType.value == 2) { useDateStr = - '${DateTool().dateToYMDHNString(state.startDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}'; + '${DateTool().dateToYMDHNString(state.startDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}'; } else if (state.keyType.value == 4) { useDateStr = - '${DateTool().dateToYMDString(state.startDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}'; + '${DateTool().dateToYMDString(state.startDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}'; } return useDateStr; } + @override void onReady() { super.onReady(); diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index 5258cf72..d943e667 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -27,7 +27,8 @@ class LockSetPage extends StatefulWidget { State createState() => _LockSetPageState(); } -class _LockSetPageState extends State with RouteAware { +class _LockSetPageState extends State + with WidgetsBindingObserver, RouteAware { final LockSetLogic logic = Get.put(LockSetLogic()); final LockSetState state = Get.find().state; @@ -41,6 +42,8 @@ class _LockSetPageState extends State with RouteAware { void initState() { super.initState(); + WidgetsBinding.instance.addObserver(this); + logic.initLoadDataAction(() { setState(() {}); }); @@ -646,7 +649,7 @@ class _LockSetPageState extends State with RouteAware { } Widget rightText(String rightTitle) { - return Text(rightTitle ?? '', + return Text(rightTitle, textAlign: TextAlign.end, style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor)); } @@ -771,10 +774,19 @@ class _LockSetPageState extends State with RouteAware { AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); } + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.paused) { + // 应用程序推入后台时清空输入框内容 + logic.state.passwordTF.clear(); + } + } + @override void dispose() { /// 取消路由订阅 AppRouteObserver().routeObserver.unsubscribe(this); + WidgetsBinding.instance.removeObserver(this); super.dispose(); } diff --git a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart index 10976c4b..9a6bd464 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -169,71 +169,7 @@ class _PasswordKeyDetailPageState extends State state.itemData.value.keyboardPwdType != 1 && state.itemData.value.keyboardPwdType != 4, child: bottomTip()), - Container(height: 40.h), - SizedBox( - width: ScreenUtil().screenWidth - 40.w, - height: 60.h, - child: OutlinedButton( - style: OutlinedButton.styleFrom( - // backgroundColor: Colors.white, - side: BorderSide(width: 1, color: AppColors.mainColor)), - onPressed: () { - Navigator.pushNamed(context, Routers.cardListPage, - arguments: { - 'lockId': state.itemData.value.lockId, - }); - }, - child: Text( - '设置卡', - style: TextStyle( - color: AppColors.mainColor, fontSize: 24.sp), - )), - ), - SizedBox( - height: 10.h, - ), - SizedBox( - width: ScreenUtil().screenWidth - 40.w, - height: 60.h, - child: OutlinedButton( - style: OutlinedButton.styleFrom( - // backgroundColor: Colors.white, - side: BorderSide(width: 1, color: AppColors.mainColor)), - onPressed: () { - Navigator.pushNamed(context, Routers.fingerprintListPage, - arguments: { - 'lockId': state.itemData.value.lockId, - }); - }, - child: Text( - '设置指纹', - style: TextStyle( - color: AppColors.mainColor, fontSize: 24.sp), - )), - ), - SizedBox( - height: 10.h, - ), - SizedBox( - width: ScreenUtil().screenWidth - 40.w, - height: 60.h, - child: OutlinedButton( - style: OutlinedButton.styleFrom( - // backgroundColor: Colors.white, - side: BorderSide(width: 1, color: AppColors.mainColor)), - onPressed: () { - Navigator.pushNamed( - context, Routers.remoteControlListPage, - arguments: { - 'lockId': state.itemData.value.lockId, - }); - }, - child: Text( - '设置遥控', - style: TextStyle( - color: AppColors.mainColor, fontSize: 24.sp), - )), - ), + SizedBox( height: 30.h, ), diff --git a/lib/mine/about/about_page.dart b/lib/mine/about/about_page.dart index b688ccd4..6f036f25 100755 --- a/lib/mine/about/about_page.dart +++ b/lib/mine/about/about_page.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; -import 'package:package_info_plus/package_info_plus.dart'; import 'package:star_lock/mine/about/about_console.dart'; import '../../app_settings/app_colors.dart'; @@ -21,10 +21,10 @@ class AboutPage extends StatefulWidget { class _AboutPageState extends State { late PackageInfo packageInfo; - String appName = ""; - String packageName = ""; - String version = "-----"; - String buildNumber = "---"; + String appName = ''; + String packageName = ''; + String version = '-----'; + String buildNumber = '---'; @override void initState() { @@ -66,13 +66,9 @@ class _AboutPageState extends State { body: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - F.sw( - skyCall: () => logoView(), - xhjCall: () => const SizedBox()), + F.sw(skyCall: logoView, xhjCall: () => const SizedBox()), listView(), - F.sw( - skyCall: () => const SizedBox(), - xhjCall: () => logoView()), + F.sw(skyCall: () => const SizedBox(), xhjCall: logoView), ], ), ); @@ -85,13 +81,13 @@ class _AboutPageState extends State { children: [ CommonItem( leftTitel: TranslationLoader.lanKeys!.introduce!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveDirection: true, action: () { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { - "url": XSConstantMacro.introduceURL, - "title": '介绍'.tr + 'url': XSConstantMacro.introduceURL, + 'title': '介绍'.tr }); }), Divider( @@ -102,13 +98,13 @@ class _AboutPageState extends State { ), CommonItem( leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveDirection: true, action: () { Get.toNamed(Routers.webviewShowPage, arguments: { - "url": XSConstantMacro.userAgreementURL, - "title": '用户协议'.tr + 'url': XSConstantMacro.userAgreementURL, + 'title': '用户协议'.tr }); }), Divider( @@ -119,13 +115,13 @@ class _AboutPageState extends State { ), CommonItem( leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveDirection: true, action: () { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { - "url": XSConstantMacro.privacyPolicyURL, - "title": '隐私政策'.tr + 'url': XSConstantMacro.privacyPolicyURL, + 'title': '隐私政策'.tr }); }), Divider( @@ -137,13 +133,13 @@ class _AboutPageState extends State { CommonItem( leftTitel: TranslationLoader .lanKeys!.personalInformationCollectionList!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveDirection: true, action: () { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { - "url": XSConstantMacro.collectionListURL, - "title": '个人信息收集清单'.tr + 'url': XSConstantMacro.collectionListURL, + 'title': '个人信息收集清单'.tr }); }), Divider( @@ -155,13 +151,13 @@ class _AboutPageState extends State { CommonItem( leftTitel: TranslationLoader.lanKeys!.applicationPermissionDescription!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveDirection: true, action: () { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { - "url": XSConstantMacro.appPermissionDescURL, - "title": '应用权限说明'.tr + 'url': XSConstantMacro.appPermissionDescURL, + 'title': '应用权限说明'.tr }); }), Divider( @@ -173,13 +169,13 @@ class _AboutPageState extends State { CommonItem( leftTitel: TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveDirection: true, action: () { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { - "url": XSConstantMacro.thirdPartyInfShareListURL, - "title": '第三方信息共享清单'.tr + 'url': XSConstantMacro.thirdPartyInfShareListURL, + 'title': '第三方信息共享清单'.tr }); }), ], @@ -221,14 +217,14 @@ class _AboutPageState extends State { borderRadius: BorderRadius.circular(20.r), child: Image.asset( F.sw( - skyCall: () => "images/icon_main_1024.png", - xhjCall: () => "images/icon_main_xhj_1024.png"), + skyCall: () => 'images/icon_main_sky_1024.png', + xhjCall: () => 'images/icon_main_xhj_1024.png'), width: 160.w, height: 160.w), ), SizedBox(height: 20.h), Text( - "${F.title} $version+$buildNumber", + '${F.title} $version+$buildNumber', style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor), ), SizedBox(height: 20.h),