fix:修复删除密码/ 卡/指纹会偶尔出现无网络的问题

This commit is contained in:
anfe 2024-07-03 15:19:41 +08:00
parent ea771f29c0
commit 35496a0827
19 changed files with 182 additions and 131 deletions

View File

@ -323,7 +323,7 @@ SPEC CHECKSUMS:
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40 audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
Bugly: 217ac2ce5f0f2626d43dbaa4f70764c953a26a31 Bugly: 217ac2ce5f0f2626d43dbaa4f70764c953a26a31
camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68 camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf
@ -337,12 +337,12 @@ SPEC CHECKSUMS:
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82 flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
fluttertoast: 77ff8760d90ff5041a97e3d0c0ecaaa8472524d2 fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
fluwx: c18fd6c16b03a2187cd07d6e48e32a7801962849 fluwx: c18fd6c16b03a2187cd07d6e48e32a7801962849
google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99 google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4 GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425 image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18
ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1
JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f
JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23 JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23
@ -351,20 +351,20 @@ SPEC CHECKSUMS:
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4 open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149 ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579 video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc
COCOAPODS: 1.12.1 COCOAPODS: 1.14.3

View File

@ -231,16 +231,17 @@ class _StarLockForgetPasswordPageState
Obx(() { Obx(() {
return SubmitBtn( return SubmitBtn(
btnName: 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], // backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey],
fontSize: 30.sp, fontSize: 30.sp,
borderRadius: 20.w, borderRadius: 20.w,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
isDisabled: state.canSub.value, isDisabled: state.canSub.value,
onClick: state.canSub.value onClick: state.canSub.value
? () { ? () async {
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ??
false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -188,9 +188,10 @@ class _StarLockForgetPasswordPageState
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
isDisabled: state.canSub.value, isDisabled: state.canSub.value,
onClick: state.canSub.value onClick: state.canSub.value
? () { ? () async {
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ??
false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -43,11 +42,13 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
children: <Widget>[ children: <Widget>[
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
'${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}', '${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}',
rightTitle: state.typeNumber.value, rightTitle: state.typeNumber.value,
isHaveDirection: false, isHaveDirection: false,
isHaveLine: true)), isHaveLine: true)),
Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr,state.typeName.value, () { Obx(() => lockDataListItem(
TranslationLoader.lanKeys!.name!.tr, state.typeName.value,
() {
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController,
'${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}', '${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}',
@ -63,12 +64,11 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(50), LengthLimitingTextInputFormatter(50),
]); ]);
})), })),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.keyType.value == 4 || visible: state.keyType.value == 4 ||
state.keyType.value == 2 || state.keyType.value == 2 ||
state.keyType.value == 1, state.keyType.value == 1,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
allHeight: 70.h, allHeight: 70.h,
@ -76,26 +76,32 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
action: () async { 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: <String, Object>{ var data = await Get.toNamed(
'pushType': 0, Routers.otherTypeKeyChangeDatePage,
'fingerprintItemData': state.fingerprintItemData.value, arguments: <String, Object>{
}); 'pushType': 0,
if(data != null) { 'fingerprintItemData':
state.fingerprintItemData.value,
});
if (data != null) {
setState(() { setState(() {
state.startDate.value = data['beginTimeTimestamp']; state.startDate.value = data['beginTimeTimestamp'];
state.endDate.value = data['endTimeTimestamp']; state.endDate.value = data['endTimeTimestamp'];
state.keyType.value = 2; state.keyType.value = 2;
}); });
} }
}else if(state.keyType.value == 4){ } else if (state.keyType.value == 4) {
// //
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: <String, Object>{ var data = await Get.toNamed(
'pushType': 0, Routers.otherTypeKeyChangeValidityDatePage,
'fingerprintItemData': state.fingerprintItemData.value, arguments: <String, Object>{
}); 'pushType': 0,
if(data != null) { 'fingerprintItemData':
state.fingerprintItemData.value,
});
if (data != null) {
setState(() { setState(() {
state.startDate.value = data['starDate']; state.startDate.value = data['starDate'];
state.endDate.value = data['endDate']; state.endDate.value = data['endDate'];
@ -114,11 +120,14 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
action: () async { action: () async {
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: <String, Object>{ var data = await Get.toNamed(
'pushType': 0, Routers.otherTypeKeyChangeValidityDatePage,
'fingerprintItemData': state.fingerprintItemData.value, arguments: <String, Object>{
}); 'pushType': 0,
if(data != null) { 'fingerprintItemData':
state.fingerprintItemData.value,
});
if (data != null) {
setState(() { setState(() {
state.startDate.value = data['starDate']; state.startDate.value = data['starDate'];
state.endDate.value = data['endDate']; state.endDate.value = data['endDate'];
@ -132,14 +141,18 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
visible: state.keyType.value == 4, visible: state.keyType.value == 4,
child: Obx(() => CommonItem( child: Obx(() => CommonItem(
leftTitel: '有效时间'.tr, 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, isHaveDirection: true,
action: () async { action: () async {
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: <String, Object>{ var data = await Get.toNamed(
'pushType': 0, Routers.otherTypeKeyChangeValidityDatePage,
'fingerprintItemData': state.fingerprintItemData.value, arguments: <String, Object>{
}); 'pushType': 0,
if(data != null) { 'fingerprintItemData':
state.fingerprintItemData.value,
});
if (data != null) {
setState(() { setState(() {
state.startDate.value = data['starDate']; state.startDate.value = data['starDate'];
state.endDate.value = data['endDate']; state.endDate.value = data['endDate'];
@ -182,11 +195,12 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
rightTitle: '', rightTitle: '',
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.lockOperatingRecordPage, arguments: <String, Object?>{ Get.toNamed(Routers.lockOperatingRecordPage,
'type': 2, arguments: <String, Object?>{
'id': state.fingerprintItemData.value.cardId.toString(), 'type': 2,
'recordName': state.fingerprintItemData.value.cardName 'id': state.fingerprintItemData.value.cardId.toString(),
}); 'recordName': state.fingerprintItemData.value.cardName
});
}), }),
// SizedBox(height: 40.h), // SizedBox(height: 40.h),
// addControlsBtn(type), // addControlsBtn(type),
@ -195,15 +209,18 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
btnName: TranslationLoader.lanKeys!.delete!.tr, btnName: TranslationLoader.lanKeys!.delete!.tr,
isDelete: true, isDelete: true,
borderRadius: 20.w, 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), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () async {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () async { ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr,
() async {
state.isDeletCard.value = true; state.isDeletCard.value = true;
logic.senderAddICCard(); logic.senderAddICCard();
}); });
@ -213,12 +230,14 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ Widget lockDataListItem(
String leftTitle, String conentStr, Function()? action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
// height: 70.h, // 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( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border( border: Border(
@ -226,15 +245,17 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
color: AppColors.greyLineColor, // color: AppColors.greyLineColor, //
width: 2.0.h, // width: 2.0.h, //
), ),
) )),
),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)), Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Expanded( 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), SizedBox(width: 10.w),
Image.asset( Image.asset(
'images/icon_right_grey.png', 'images/icon_right_grey.png',
@ -282,6 +303,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
/// ///
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
} }

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -70,7 +69,8 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
onPressed: () async { onPressed: () async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -145,8 +145,10 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
motion: const ScrollMotion(), motion: const ScrollMotion(),
children: <Widget>[ children: <Widget>[
SlidableAction( SlidableAction(
onPressed: (BuildContext context) { onPressed: (BuildContext context) async {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ??
false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -69,7 +69,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
await Storage.getBool(ifIsDemoModeOrNot); await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -207,8 +206,9 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () async {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -68,7 +67,8 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
onPressed: () async { onPressed: () async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -115,11 +115,11 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
btnName: btnName:
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}', '${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
onClick: () async { onClick: () async {
final data = final data = await Get.toNamed(Routers.addFaceTypePage,
await Get.toNamed(Routers.addFaceTypePage, arguments: <String, int>{ arguments: <String, int>{
'lockId': state.lockId.value, 'lockId': state.lockId.value,
'fromType': 1 // 1 2 'fromType': 1 // 1 2
}); });
if (data != null) { if (data != null) {
logic.pageNo = 1; logic.pageNo = 1;
getHttpData(); getHttpData();
@ -158,10 +158,10 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
getFaceItemData.faceName!, getFaceItemData.faceName!,
logic.getKeyType(getFaceItemData), logic.getKeyType(getFaceItemData),
logic.getKeyDateType(getFaceItemData), () async { logic.getKeyDateType(getFaceItemData), () async {
final data = final data = await Get.toNamed(Routers.faceDetailPage,
await Get.toNamed(Routers.faceDetailPage, arguments: <String, FingerprintItemData>{ arguments: <String, FingerprintItemData>{
'faceItemData': getFaceItemData, 'faceItemData': getFaceItemData,
}); });
if (data != null) { if (data != null) {
logic.pageNo = 1; logic.pageNo = 1;
getHttpData(); getHttpData();
@ -184,8 +184,9 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
Widget _buildDeleteBtn(FingerprintItemData faceItemData) { Widget _buildDeleteBtn(FingerprintItemData faceItemData) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () async {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -43,11 +43,13 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
children: <Widget>[ children: <Widget>[
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
'${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}', '${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}',
rightTitle: state.typeNumber.value, rightTitle: state.typeNumber.value,
isHaveDirection: false, isHaveDirection: false,
isHaveLine: true)), isHaveLine: true)),
Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.typeName.value, () { Obx(() => lockDataListItem(
TranslationLoader.lanKeys!.name!.tr, state.typeName.value,
() {
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController,
'${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}', '${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}',
@ -66,8 +68,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
})), })),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.keyType.value == 4 || visible: state.keyType.value == 4 ||
state.keyType.value == 2 || state.keyType.value == 2 ||
state.keyType.value == 1, state.keyType.value == 1,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
allHeight: 70.h, allHeight: 70.h,
@ -149,7 +151,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
Routers.otherTypeKeyChangeValidityDatePage, Routers.otherTypeKeyChangeValidityDatePage,
arguments: <String, Object>{ arguments: <String, Object>{
'pushType': 1, 'pushType': 1,
'fingerprintItemData': state.fingerprintItemData.value, 'fingerprintItemData':
state.fingerprintItemData.value,
}); });
if (data != null) { if (data != null) {
setState(() { setState(() {
@ -195,11 +198,14 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
// //
Get.toNamed(Routers.lockOperatingRecordPage, arguments: <String, Object?>{ Get.toNamed(Routers.lockOperatingRecordPage,
'type': 3, arguments: <String, Object?>{
'id': state.fingerprintItemData.value.fingerprintId.toString(), 'type': 3,
'recordName': state.fingerprintItemData.value.fingerprintName 'id': state.fingerprintItemData.value.fingerprintId
}); .toString(),
'recordName':
state.fingerprintItemData.value.fingerprintName
});
}), }),
// SizedBox(height: 40.h), // SizedBox(height: 40.h),
// addControlsBtn(type), // addControlsBtn(type),
@ -211,8 +217,9 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () async {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -228,12 +235,14 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ Widget lockDataListItem(
String leftTitle, String conentStr, Function()? action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
// height: 70.h, // 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( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border( border: Border(
@ -241,15 +250,17 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
color: AppColors.greyLineColor, // color: AppColors.greyLineColor, //
width: 2.0.h, // width: 2.0.h, //
), ),
) )),
),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)), Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Expanded( 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), SizedBox(width: 10.w),
Image.asset( Image.asset(
'images/icon_right_grey.png', 'images/icon_right_grey.png',

View File

@ -70,7 +70,8 @@ class _FingerprintListPageState extends State<FingerprintListPage>
onPressed: () async { onPressed: () async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -144,11 +145,14 @@ class _FingerprintListPageState extends State<FingerprintListPage>
extentRatio: 0.2, extentRatio: 0.2,
motion: const ScrollMotion(), motion: const ScrollMotion(),
children: <Widget>[ children: <Widget>[
SlidableAction(onPressed: (BuildContext context) { SlidableAction(
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; onPressed: (BuildContext context) async {
if (!isNetWork) { final bool isNetWork =
return; await LockMainLogic.to()?.judgeTheNetwork() ??
} false;
if (!isNetWork) {
return;
}
ShowTipView().showIosTipWithContentDialog( ShowTipView().showIosTipWithContentDialog(
'确定要删除吗?'.tr, () async { '确定要删除吗?'.tr, () async {
state.isDeletAll = false; state.isDeletAll = false;

View File

@ -46,7 +46,7 @@ class _IrisListPageState extends State<IrisListPage> {
final isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); final isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -1430,11 +1430,11 @@ class _LockDetailPageState extends State<LockDetailPage>
} }
} }
void startOpenLock() { Future<void> startOpenLock() async{
if (state.openLockBtnState.value == 1) { if (state.openLockBtnState.value == 1) {
return; return;
} }
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false;
final bool isOpenLockNeedOnline = state.isOpenLockNeedOnline.value == 0; final bool isOpenLockNeedOnline = state.isOpenLockNeedOnline.value == 0;
if (!isOpenLockNeedOnline && !isNetWork) { if (!isOpenLockNeedOnline && !isNetWork) {
return; return;

View File

@ -158,13 +158,13 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
child: SubmitBtn( child: SubmitBtn(
btnName: TranslationLoader.lanKeys!.delete!.tr, btnName: TranslationLoader.lanKeys!.delete!.tr,
isDelete: true, isDelete: true,
onClick: () { onClick: () async {
// logic.deletUserAction(); // logic.deletUserAction();
// logic.deletLockInfoData(); // logic.deletLockInfoData();
// showDeletAlertDialog(context); // showDeletAlertDialog(context);
// showDeletPasswordAlertDialog(context); // showDeletPasswordAlertDialog(context);
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -35,9 +35,9 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
TranslationLoader.lanKeys!.reset!.tr, TranslationLoader.lanKeys!.reset!.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp), style: TextStyle(color: Colors.white, fontSize: 24.sp),
), ),
onPressed: () { onPressed: () async {
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -46,7 +46,7 @@ class _PalmListPageState extends State<PalmListPage> {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -106,7 +106,7 @@ class _PalmListPageState extends State<PalmListPage> {
// //
if (index < state.faceItemListData.value.length) { if (index < state.faceItemListData.value.length) {
return LeftSlideActions( return LeftSlideActions(
tag:getFaceItemData.faceName!, tag: getFaceItemData.faceName!,
key: Key(getFaceItemData.faceName!), key: Key(getFaceItemData.faceName!),
actionsWidth: 60, actionsWidth: 60,
actions: [ actions: [

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -86,9 +85,11 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
// showCupertinoAlertDialog( // showCupertinoAlertDialog(
// context, state.inputNameController); // context, state.inputNameController);
// })), // })),
Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.keyboardPwdName.value, (){ Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr,
showCupertinoAlertDialog(context, state.inputNameController); state.keyboardPwdName.value, () {
})), showCupertinoAlertDialog(
context, state.inputNameController);
})),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '有效期', leftTitel: '有效期',
rightTitle: logic.getUseDateStr(), rightTitle: logic.getUseDateStr(),
@ -243,8 +244,9 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () async {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -295,12 +297,14 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ Widget lockDataListItem(
String leftTitle, String conentStr, Function()? action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
// height: 70.h, // 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( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border( border: Border(
@ -308,15 +312,17 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
color: AppColors.greyLineColor, // color: AppColors.greyLineColor, //
width: 2.0.h, // width: 2.0.h, //
), ),
) )),
),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)), Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Expanded( 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), SizedBox(width: 10.w),
Image.asset( Image.asset(
'images/icon_right_grey.png', 'images/icon_right_grey.png',

View File

@ -68,7 +68,8 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
final bool? isDemoMode = final bool? isDemoMode =
await Storage.getBool(ifIsDemoModeOrNot); await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -154,8 +155,10 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
motion: const ScrollMotion(), motion: const ScrollMotion(),
children: <Widget>[ children: <Widget>[
SlidableAction( SlidableAction(
onPressed: (BuildContext context) { onPressed: (BuildContext context) async {
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ??
false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -46,7 +46,7 @@ class _RemoteControlListPageState extends State<RemoteControlListPage> {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = final bool isNetWork =
LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }

View File

@ -110,15 +110,15 @@ class LockMainLogic extends BaseGetXController {
// //
state.networkConnectionStatus.value = 1; state.networkConnectionStatus.value = 1;
getStarLockInfo(isUnShowLoading: true); getStarLockInfo(isUnShowLoading: true);
}else if(result == ConnectivityResult.none){ } else if (result == ConnectivityResult.none) {
state.networkConnectionStatus.value = 0; state.networkConnectionStatus.value = 0;
} }
}); });
} }
/// ///
bool judgeTheNetwork() { Future<bool> judgeTheNetwork() async {
final bool isNetwork = state.networkConnectionStatus.value == 1; final bool isNetwork = await isConnected();
if (!isNetwork) { if (!isNetwork) {
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr); EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr);
} }