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
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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<CardDetailPage> with RouteAware {
children: <Widget>[
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<CardDetailPage> 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<CardDetailPage> 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: <String, Object>{
'pushType': 0,
'fingerprintItemData': state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeDatePage,
arguments: <String, Object>{
'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: <String, Object>{
'pushType': 0,
'fingerprintItemData': state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeValidityDatePage,
arguments: <String, Object>{
'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<CardDetailPage> with RouteAware {
isHaveDirection: true,
isHaveLine: true,
action: () async {
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: <String, Object>{
'pushType': 0,
'fingerprintItemData': state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeValidityDatePage,
arguments: <String, Object>{
'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<CardDetailPage> 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: <String, Object>{
'pushType': 0,
'fingerprintItemData': state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeValidityDatePage,
arguments: <String, Object>{
'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<CardDetailPage> with RouteAware {
rightTitle: '',
isHaveDirection: true,
action: () {
Get.toNamed(Routers.lockOperatingRecordPage, arguments: <String, Object?>{
'type': 2,
'id': state.fingerprintItemData.value.cardId.toString(),
'recordName': state.fingerprintItemData.value.cardName
});
Get.toNamed(Routers.lockOperatingRecordPage,
arguments: <String, Object?>{
'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<CardDetailPage> 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<CardDetailPage> 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<CardDetailPage> with RouteAware {
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
)),
child: Row(
children: <Widget>[
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<CardDetailPage> with RouteAware {
@override
void didChangeDependencies() {
super.didChangeDependencies();
///
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}

View File

@ -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<CardListPage> 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<CardListPage> with RouteAware {
motion: const ScrollMotion(),
children: <Widget>[
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;
}

View File

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

View File

@ -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<FaceDetailPage> 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;
}

View File

@ -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<FaceListPage> 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<FaceListPage> with RouteAware {
btnName:
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
onClick: () async {
final data =
await Get.toNamed(Routers.addFaceTypePage, arguments: <String, int>{
'lockId': state.lockId.value,
'fromType': 1 // 1 2
});
final data = await Get.toNamed(Routers.addFaceTypePage,
arguments: <String, int>{
'lockId': state.lockId.value,
'fromType': 1 // 1 2
});
if (data != null) {
logic.pageNo = 1;
getHttpData();
@ -158,10 +158,10 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
getFaceItemData.faceName!,
logic.getKeyType(getFaceItemData),
logic.getKeyDateType(getFaceItemData), () async {
final data =
await Get.toNamed(Routers.faceDetailPage, arguments: <String, FingerprintItemData>{
'faceItemData': getFaceItemData,
});
final data = await Get.toNamed(Routers.faceDetailPage,
arguments: <String, FingerprintItemData>{
'faceItemData': getFaceItemData,
});
if (data != null) {
logic.pageNo = 1;
getHttpData();
@ -184,8 +184,9 @@ class _FaceListPageState extends State<FaceListPage> 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;
}

View File

@ -43,11 +43,13 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
children: <Widget>[
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<FingerprintDetailPage>
})),
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<FingerprintDetailPage>
Routers.otherTypeKeyChangeValidityDatePage,
arguments: <String, Object>{
'pushType': 1,
'fingerprintItemData': state.fingerprintItemData.value,
'fingerprintItemData':
state.fingerprintItemData.value,
});
if (data != null) {
setState(() {
@ -195,11 +198,14 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
isHaveDirection: true,
action: () {
//
Get.toNamed(Routers.lockOperatingRecordPage, arguments: <String, Object?>{
'type': 3,
'id': state.fingerprintItemData.value.fingerprintId.toString(),
'recordName': state.fingerprintItemData.value.fingerprintName
});
Get.toNamed(Routers.lockOperatingRecordPage,
arguments: <String, Object?>{
'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<FingerprintDetailPage>
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<FingerprintDetailPage>
);
}
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<FingerprintDetailPage>
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
)),
child: Row(
children: <Widget>[
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',

View File

@ -70,7 +70,8 @@ class _FingerprintListPageState extends State<FingerprintListPage>
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<FingerprintListPage>
extentRatio: 0.2,
motion: const ScrollMotion(),
children: <Widget>[
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;

View File

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

View File

@ -1430,11 +1430,11 @@ class _LockDetailPageState extends State<LockDetailPage>
}
}
void startOpenLock() {
Future<void> 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;

View File

@ -158,13 +158,13 @@ class _LockSetPageState extends State<LockSetPage> 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;
}

View File

@ -35,9 +35,9 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
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;
}

View File

@ -46,7 +46,7 @@ class _PalmListPageState extends State<PalmListPage> {
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<PalmListPage> {
//
if (index < state.faceItemListData.value.length) {
return LeftSlideActions(
tag:getFaceItemData.faceName!,
tag: getFaceItemData.faceName!,
key: Key(getFaceItemData.faceName!),
actionsWidth: 60,
actions: [

View File

@ -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<PasswordKeyDetailPage>
// 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<PasswordKeyDetailPage>
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<PasswordKeyDetailPage>
);
}
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<PasswordKeyDetailPage>
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
)),
child: Row(
children: <Widget>[
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',

View File

@ -68,7 +68,8 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
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<PasswordKeyListPage>
motion: const ScrollMotion(),
children: <Widget>[
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;
}

View File

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

View File

@ -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<bool> judgeTheNetwork() async {
final bool isNetwork = await isConnected();
if (!isNetwork) {
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr);
}