diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 613467b6..1b0b0834 100755 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -323,7 +323,7 @@ SPEC CHECKSUMS: audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40 auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d Bugly: 217ac2ce5f0f2626d43dbaa4f70764c953a26a31 - camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68 + camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf @@ -337,12 +337,12 @@ SPEC CHECKSUMS: flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82 - fluttertoast: 77ff8760d90ff5041a97e3d0c0ecaaa8472524d2 + fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db fluwx: c18fd6c16b03a2187cd07d6e48e32a7801962849 google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99 GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4 image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb - image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425 + image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18 ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23 @@ -351,20 +351,20 @@ SPEC CHECKSUMS: network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4 package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e - path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149 SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb - shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 + shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e - url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 - video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579 - webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 + url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe + video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 + webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.3 diff --git a/lib/login/forgetPassword/starLock_forgetPassword_page.dart b/lib/login/forgetPassword/starLock_forgetPassword_page.dart index 27e22275..f71c5186 100755 --- a/lib/login/forgetPassword/starLock_forgetPassword_page.dart +++ b/lib/login/forgetPassword/starLock_forgetPassword_page.dart @@ -231,16 +231,17 @@ class _StarLockForgetPasswordPageState Obx(() { return SubmitBtn( btnName: - "${TranslationLoader.lanKeys!.reset!.tr}${TranslationLoader.lanKeys!.password!.tr}", + '${TranslationLoader.lanKeys!.reset!.tr}${TranslationLoader.lanKeys!.password!.tr}', // backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey], fontSize: 30.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), isDisabled: state.canSub.value, onClick: state.canSub.value - ? () { + ? () async { final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? + false; if (!isNetWork) { return; } diff --git a/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart b/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart index ae08975b..307d6feb 100755 --- a/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart +++ b/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart @@ -188,9 +188,10 @@ class _StarLockForgetPasswordPageState padding: EdgeInsets.only(top: 25.w, bottom: 25.w), isDisabled: state.canSub.value, onClick: state.canSub.value - ? () { + ? () async { final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? + false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart b/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart index d6d951ca..08b2b7e9 100755 --- a/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart +++ b/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -43,11 +42,13 @@ class _CardDetailPageState extends State with RouteAware { children: [ Obx(() => CommonItem( leftTitel: - '${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}', + '${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}', rightTitle: state.typeNumber.value, isHaveDirection: false, isHaveLine: true)), - Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr,state.typeName.value, () { + Obx(() => lockDataListItem( + TranslationLoader.lanKeys!.name!.tr, state.typeName.value, + () { ShowTipView().showTFViewAlertDialog( state.changeNameController, '${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}', @@ -63,12 +64,11 @@ class _CardDetailPageState extends State with RouteAware { FilteringTextInputFormatter.deny('\n'), LengthLimitingTextInputFormatter(50), ]); - })), Obx(() => Visibility( visible: state.keyType.value == 4 || - state.keyType.value == 2 || - state.keyType.value == 1, + state.keyType.value == 2 || + state.keyType.value == 1, child: CommonItem( leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, allHeight: 70.h, @@ -76,26 +76,32 @@ class _CardDetailPageState extends State with RouteAware { isHaveDirection: true, isHaveLine: true, action: () async { - if(state.keyType.value == 2 || state.keyType.value == 1){ + if (state.keyType.value == 2 || state.keyType.value == 1) { // 限时 - var data = await Get.toNamed(Routers.otherTypeKeyChangeDatePage, arguments: { - 'pushType': 0, - 'fingerprintItemData': state.fingerprintItemData.value, - }); - if(data != null) { + var data = await Get.toNamed( + Routers.otherTypeKeyChangeDatePage, + arguments: { + 'pushType': 0, + 'fingerprintItemData': + state.fingerprintItemData.value, + }); + if (data != null) { setState(() { state.startDate.value = data['beginTimeTimestamp']; state.endDate.value = data['endTimeTimestamp']; state.keyType.value = 2; }); } - }else if(state.keyType.value == 4){ + } else if (state.keyType.value == 4) { // 循环 - var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: { - 'pushType': 0, - 'fingerprintItemData': state.fingerprintItemData.value, - }); - if(data != null) { + var data = await Get.toNamed( + Routers.otherTypeKeyChangeValidityDatePage, + arguments: { + 'pushType': 0, + 'fingerprintItemData': + state.fingerprintItemData.value, + }); + if (data != null) { setState(() { state.startDate.value = data['starDate']; state.endDate.value = data['endDate']; @@ -114,11 +120,14 @@ class _CardDetailPageState extends State with RouteAware { isHaveDirection: true, isHaveLine: true, action: () async { - var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: { - 'pushType': 0, - 'fingerprintItemData': state.fingerprintItemData.value, - }); - if(data != null) { + var data = await Get.toNamed( + Routers.otherTypeKeyChangeValidityDatePage, + arguments: { + 'pushType': 0, + 'fingerprintItemData': + state.fingerprintItemData.value, + }); + if (data != null) { setState(() { state.startDate.value = data['starDate']; state.endDate.value = data['endDate']; @@ -132,14 +141,18 @@ class _CardDetailPageState extends State with RouteAware { visible: state.keyType.value == 4, child: Obx(() => CommonItem( leftTitel: '有效时间'.tr, - rightTitle: '${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}', + rightTitle: + '${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}', isHaveDirection: true, action: () async { - var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: { - 'pushType': 0, - 'fingerprintItemData': state.fingerprintItemData.value, - }); - if(data != null) { + var data = await Get.toNamed( + Routers.otherTypeKeyChangeValidityDatePage, + arguments: { + 'pushType': 0, + 'fingerprintItemData': + state.fingerprintItemData.value, + }); + if (data != null) { setState(() { state.startDate.value = data['starDate']; state.endDate.value = data['endDate']; @@ -182,11 +195,12 @@ class _CardDetailPageState extends State with RouteAware { rightTitle: '', isHaveDirection: true, action: () { - Get.toNamed(Routers.lockOperatingRecordPage, arguments: { - 'type': 2, - 'id': state.fingerprintItemData.value.cardId.toString(), - 'recordName': state.fingerprintItemData.value.cardName - }); + Get.toNamed(Routers.lockOperatingRecordPage, + arguments: { + 'type': 2, + 'id': state.fingerprintItemData.value.cardId.toString(), + 'recordName': state.fingerprintItemData.value.cardName + }); }), // SizedBox(height: 40.h), // addControlsBtn(type), @@ -195,15 +209,18 @@ class _CardDetailPageState extends State with RouteAware { btnName: TranslationLoader.lanKeys!.delete!.tr, isDelete: true, borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + margin: EdgeInsets.only( + left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + onClick: () async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } - ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () async { + ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, + () async { state.isDeletCard.value = true; logic.senderAddICCard(); }); @@ -213,12 +230,14 @@ class _CardDetailPageState extends State with RouteAware { ); } - Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ + Widget lockDataListItem( + String leftTitle, String conentStr, Function()? action) { return GestureDetector( onTap: action, child: Container( // height: 70.h, - padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), + padding: + EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), decoration: BoxDecoration( color: Colors.white, border: Border( @@ -226,15 +245,17 @@ class _CardDetailPageState extends State with RouteAware { color: AppColors.greyLineColor, // 设置边框颜色 width: 2.0.h, // 设置边框宽度 ), - ) - ), + )), child: Row( children: [ Text(leftTitle, style: TextStyle(fontSize: 22.sp)), SizedBox(width: 10.w), Expanded( - child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, )) - ), + child: Text(conentStr, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 22.sp, + ))), SizedBox(width: 10.w), Image.asset( 'images/icon_right_grey.png', @@ -282,6 +303,7 @@ class _CardDetailPageState extends State with RouteAware { @override void didChangeDependencies() { super.didChangeDependencies(); + /// 路由订阅 AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); } diff --git a/lib/main/lockDetail/card/cardList/cardList_page.dart b/lib/main/lockDetail/card/cardList/cardList_page.dart index 6731b623..ae3558d7 100755 --- a/lib/main/lockDetail/card/cardList/cardList_page.dart +++ b/lib/main/lockDetail/card/cardList/cardList_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -70,7 +69,8 @@ class _CardListPageState extends State with RouteAware { onPressed: () async { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -145,8 +145,10 @@ class _CardListPageState extends State with RouteAware { motion: const ScrollMotion(), children: [ SlidableAction( - onPressed: (BuildContext context) { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + onPressed: (BuildContext context) async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? + false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart index df183855..c3ca83fd 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart @@ -69,7 +69,7 @@ class _ElectronicKeyListPageState extends State { await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart b/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart index 8ba6a825..4556f2bf 100755 --- a/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart +++ b/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -207,8 +206,9 @@ class _FaceDetailPageState extends State with RouteAware { margin: EdgeInsets.only( left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + onClick: () async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/face/faceList/faceList_page.dart b/lib/main/lockDetail/face/faceList/faceList_page.dart index e923b267..825af7f2 100755 --- a/lib/main/lockDetail/face/faceList/faceList_page.dart +++ b/lib/main/lockDetail/face/faceList/faceList_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -68,7 +67,8 @@ class _FaceListPageState extends State with RouteAware { onPressed: () async { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -115,11 +115,11 @@ class _FaceListPageState extends State with RouteAware { btnName: '${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}', onClick: () async { - final data = - await Get.toNamed(Routers.addFaceTypePage, arguments: { - 'lockId': state.lockId.value, - 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - }); + final data = await Get.toNamed(Routers.addFaceTypePage, + arguments: { + 'lockId': state.lockId.value, + 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 + }); if (data != null) { logic.pageNo = 1; getHttpData(); @@ -158,10 +158,10 @@ class _FaceListPageState extends State with RouteAware { getFaceItemData.faceName!, logic.getKeyType(getFaceItemData), logic.getKeyDateType(getFaceItemData), () async { - final data = - await Get.toNamed(Routers.faceDetailPage, arguments: { - 'faceItemData': getFaceItemData, - }); + final data = await Get.toNamed(Routers.faceDetailPage, + arguments: { + 'faceItemData': getFaceItemData, + }); if (data != null) { logic.pageNo = 1; getHttpData(); @@ -184,8 +184,9 @@ class _FaceListPageState extends State with RouteAware { Widget _buildDeleteBtn(FingerprintItemData faceItemData) { return GestureDetector( - onTap: () { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + onTap: () async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart b/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart index 358b4712..096c7c3a 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart @@ -43,11 +43,13 @@ class _FingerprintDetailPageState extends State children: [ Obx(() => CommonItem( leftTitel: - '${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}', + '${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}', rightTitle: state.typeNumber.value, isHaveDirection: false, isHaveLine: true)), - Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.typeName.value, () { + Obx(() => lockDataListItem( + TranslationLoader.lanKeys!.name!.tr, state.typeName.value, + () { ShowTipView().showTFViewAlertDialog( state.changeNameController, '${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}', @@ -66,8 +68,8 @@ class _FingerprintDetailPageState extends State })), Obx(() => Visibility( visible: state.keyType.value == 4 || - state.keyType.value == 2 || - state.keyType.value == 1, + state.keyType.value == 2 || + state.keyType.value == 1, child: CommonItem( leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, allHeight: 70.h, @@ -149,7 +151,8 @@ class _FingerprintDetailPageState extends State Routers.otherTypeKeyChangeValidityDatePage, arguments: { 'pushType': 1, - 'fingerprintItemData': state.fingerprintItemData.value, + 'fingerprintItemData': + state.fingerprintItemData.value, }); if (data != null) { setState(() { @@ -195,11 +198,14 @@ class _FingerprintDetailPageState extends State isHaveDirection: true, action: () { // 指纹 - Get.toNamed(Routers.lockOperatingRecordPage, arguments: { - 'type': 3, - 'id': state.fingerprintItemData.value.fingerprintId.toString(), - 'recordName': state.fingerprintItemData.value.fingerprintName - }); + Get.toNamed(Routers.lockOperatingRecordPage, + arguments: { + 'type': 3, + 'id': state.fingerprintItemData.value.fingerprintId + .toString(), + 'recordName': + state.fingerprintItemData.value.fingerprintName + }); }), // SizedBox(height: 40.h), // addControlsBtn(type), @@ -211,8 +217,9 @@ class _FingerprintDetailPageState extends State margin: EdgeInsets.only( left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + onClick: () async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -228,12 +235,14 @@ class _FingerprintDetailPageState extends State ); } - Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ + Widget lockDataListItem( + String leftTitle, String conentStr, Function()? action) { return GestureDetector( onTap: action, child: Container( // height: 70.h, - padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), + padding: + EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), decoration: BoxDecoration( color: Colors.white, border: Border( @@ -241,15 +250,17 @@ class _FingerprintDetailPageState extends State color: AppColors.greyLineColor, // 设置边框颜色 width: 2.0.h, // 设置边框宽度 ), - ) - ), + )), child: Row( children: [ Text(leftTitle, style: TextStyle(fontSize: 22.sp)), SizedBox(width: 10.w), Expanded( - child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, )) - ), + child: Text(conentStr, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 22.sp, + ))), SizedBox(width: 10.w), Image.asset( 'images/icon_right_grey.png', diff --git a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart index f3e80240..c3ba3bb0 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart @@ -70,7 +70,8 @@ class _FingerprintListPageState extends State onPressed: () async { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -144,11 +145,14 @@ class _FingerprintListPageState extends State extentRatio: 0.2, motion: const ScrollMotion(), children: [ - SlidableAction(onPressed: (BuildContext context) { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; - if (!isNetWork) { - return; - } + SlidableAction( + onPressed: (BuildContext context) async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? + false; + if (!isNetWork) { + return; + } ShowTipView().showIosTipWithContentDialog( '确定要删除吗?'.tr, () async { state.isDeletAll = false; diff --git a/lib/main/lockDetail/iris/irisList/irisList_page.dart b/lib/main/lockDetail/iris/irisList/irisList_page.dart index bc4f4fe8..1be0a00f 100755 --- a/lib/main/lockDetail/iris/irisList/irisList_page.dart +++ b/lib/main/lockDetail/iris/irisList/irisList_page.dart @@ -46,7 +46,7 @@ class _IrisListPageState extends State { final isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index b49677af..b0199e42 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -1430,11 +1430,11 @@ class _LockDetailPageState extends State } } - void startOpenLock() { + Future startOpenLock() async{ if (state.openLockBtnState.value == 1) { return; } - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isOpenLockNeedOnline = state.isOpenLockNeedOnline.value == 0; if (!isOpenLockNeedOnline && !isNetWork) { return; diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index 411ce532..5258cf72 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -158,13 +158,13 @@ class _LockSetPageState extends State with RouteAware { child: SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, isDelete: true, - onClick: () { + onClick: () async { // logic.deletUserAction(); // logic.deletLockInfoData(); // showDeletAlertDialog(context); // showDeletPasswordAlertDialog(context); final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart b/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart index ca725531..c833785f 100755 --- a/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart +++ b/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart @@ -35,9 +35,9 @@ class _WirelessKeyboardPageState extends State { TranslationLoader.lanKeys!.reset!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp), ), - onPressed: () { + onPressed: () async { final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/palm/palmList/palmList_page.dart b/lib/main/lockDetail/palm/palmList/palmList_page.dart index 18e153a0..df52b2cc 100755 --- a/lib/main/lockDetail/palm/palmList/palmList_page.dart +++ b/lib/main/lockDetail/palm/palmList/palmList_page.dart @@ -46,7 +46,7 @@ class _PalmListPageState extends State { var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -106,7 +106,7 @@ class _PalmListPageState extends State { // 人脸 if (index < state.faceItemListData.value.length) { return LeftSlideActions( - tag:getFaceItemData.faceName!, + tag: getFaceItemData.faceName!, key: Key(getFaceItemData.faceName!), actionsWidth: 60, actions: [ diff --git a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart index 81ff813e..9a75f793 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -86,9 +85,11 @@ class _PasswordKeyDetailPageState extends State // showCupertinoAlertDialog( // context, state.inputNameController); // })), - Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.keyboardPwdName.value, (){ - showCupertinoAlertDialog(context, state.inputNameController); - })), + Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, + state.keyboardPwdName.value, () { + showCupertinoAlertDialog( + context, state.inputNameController); + })), Obx(() => CommonItem( leftTitel: '有效期', rightTitle: logic.getUseDateStr(), @@ -243,8 +244,9 @@ class _PasswordKeyDetailPageState extends State margin: EdgeInsets.only( left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + onClick: () async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -295,12 +297,14 @@ class _PasswordKeyDetailPageState extends State ); } - Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ + Widget lockDataListItem( + String leftTitle, String conentStr, Function()? action) { return GestureDetector( onTap: action, child: Container( // height: 70.h, - padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), + padding: + EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), decoration: BoxDecoration( color: Colors.white, border: Border( @@ -308,15 +312,17 @@ class _PasswordKeyDetailPageState extends State color: AppColors.greyLineColor, // 设置边框颜色 width: 2.0.h, // 设置边框宽度 ), - ) - ), + )), child: Row( children: [ Text(leftTitle, style: TextStyle(fontSize: 22.sp)), SizedBox(width: 10.w), Expanded( - child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, )) - ), + child: Text(conentStr, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 22.sp, + ))), SizedBox(width: 10.w), Image.asset( 'images/icon_right_grey.png', diff --git a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart index 33ccdc4d..ccc90b5b 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart @@ -68,7 +68,8 @@ class _PasswordKeyListPageState extends State final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -154,8 +155,10 @@ class _PasswordKeyListPageState extends State motion: const ScrollMotion(), children: [ SlidableAction( - onPressed: (BuildContext context) { - final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; + onPressed: (BuildContext context) async { + final bool isNetWork = + await LockMainLogic.to()?.judgeTheNetwork() ?? + false; if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart b/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart index 5f193cd1..6ab01f50 100755 --- a/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart +++ b/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart @@ -46,7 +46,7 @@ class _RemoteControlListPageState extends State { var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { final bool isNetWork = - LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } diff --git a/lib/main/lockMian/lockMain/lockMain_logic.dart b/lib/main/lockMian/lockMain/lockMain_logic.dart index 6bd0b1ee..32852a77 100755 --- a/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -110,15 +110,15 @@ class LockMainLogic extends BaseGetXController { // 从无网络到有网络 state.networkConnectionStatus.value = 1; getStarLockInfo(isUnShowLoading: true); - }else if(result == ConnectivityResult.none){ + } else if (result == ConnectivityResult.none) { state.networkConnectionStatus.value = 0; } }); } /// 判断是否有网络 - bool judgeTheNetwork() { - final bool isNetwork = state.networkConnectionStatus.value == 1; + Future judgeTheNetwork() async { + final bool isNetwork = await isConnected(); if (!isNetwork) { EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr); }