794 lines
30 KiB
Dart
Raw Normal View History

2023-09-07 18:36:16 +08:00
import 'package:flutter/cupertino.dart';
2023-07-10 17:50:31 +08:00
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/appRouteObserver.dart';
2023-07-10 17:50:31 +08:00
import '../../../../tools/commonItem.dart';
2023-11-01 17:28:59 +08:00
2023-10-17 15:49:09 +08:00
import '../../../../tools/showTFView.dart';
2023-07-10 17:50:31 +08:00
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
2023-09-07 18:36:16 +08:00
import '../../../../tools/toast.dart';
2023-07-10 17:50:31 +08:00
import '../../../../translations/trans_lib.dart';
import 'lockSet_logic.dart';
2023-07-10 17:50:31 +08:00
class LockSetPage extends StatefulWidget {
2023-07-15 15:11:28 +08:00
const LockSetPage({Key? key}) : super(key: key);
2023-07-10 17:50:31 +08:00
@override
State<LockSetPage> createState() => _LockSetPageState();
}
class _LockSetPageState extends State<LockSetPage> with RouteAware {
final logic = Get.put(LockSetLogic());
final state = Get.find<LockSetLogic>().state;
2023-09-07 18:36:16 +08:00
@override
void initState() {
// TODO: implement initState
super.initState();
logic.initLoadDataAction(() {
setState(() {});
});
}
2023-07-10 17:50:31 +08:00
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.set!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(
2023-07-10 17:50:31 +08:00
children: [
Expanded(
child: ListView(
children: [
2023-10-12 14:00:49 +08:00
// 基本信息
CommonItem(
leftTitel:
TranslationLoader.lanKeys!.basicInformation!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.basicInformationPage, arguments: {
2023-11-01 17:28:59 +08:00
'lockSetInfoData': state.lockSetInfoData.value
});
}),
2023-11-01 17:28:59 +08:00
SizedBox(height: 10.h),
2023-10-12 14:00:49 +08:00
// 门磁
2023-11-01 17:28:59 +08:00
Obx(() => Visibility(
visible: state.lockFeature.value.doorStatus == 1
? true
: false,
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.doorMagnetic!.tr,
2023-10-12 14:00:49 +08:00
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.doorMagneticPage);
// Toast.show(msg: "功能暂未开放");
2023-11-01 17:28:59 +08:00
}))),
2023-10-12 14:00:49 +08:00
// 无线键盘
2023-11-01 17:28:59 +08:00
Obx(() => Visibility(
visible: state.lockFeature.value.wirelessKeyboard == 1
? true
: false,
2023-10-07 18:55:59 +08:00
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.wirelessKeyboardPage);
// Toast.show(msg: "功能暂未开放");
2023-11-01 17:28:59 +08:00
}))),
// 照明
Obx(() => Visibility(
visible: state.lockFeature.value.lightingTime == 1
? true
: false,
child: CommonItem(
leftTitel: '照明',
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Toast.show(msg: "功能暂未开放");
2023-11-01 17:28:59 +08:00
}))),
// 开门器
Visibility(
visible: true,
child: CommonItem(
leftTitel: '开门器',
2023-10-07 18:55:59 +08:00
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
2023-10-12 14:00:49 +08:00
Toast.show(msg: "功能暂未开放");
})),
2023-10-07 18:55:59 +08:00
SizedBox(height: 10.h),
2023-10-12 14:00:49 +08:00
// 自动闭锁
2023-10-07 18:55:59 +08:00
Obx(() => Visibility(
visible:
state.lockFeature.value.autoLock == 1 ? true : false,
2023-10-07 18:55:59 +08:00
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.automaticBlocking!.tr,
rightTitle: (state.lockSettingInfo.value.autoLock ??
0) >
0
2023-11-01 17:28:59 +08:00
? "${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond ?? 0}s"
2023-10-07 18:55:59 +08:00
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
2023-11-01 17:28:59 +08:00
// isHaveRightWidget: true,
// rightWidget: rightText((state.lockSetInfoData.value.lockSetting!.autoLock ?? 0) > 0
// ? "${state.lockSetInfoData.value.lockSetting!.autoLockSecond ?? 0}s"
// : TranslationLoader.lanKeys!.closed!.tr),
2023-10-07 18:55:59 +08:00
action: () {
Get.toNamed(Routers.automaticBlockingPage,
arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
}))),
2023-10-12 14:00:49 +08:00
// 锁声音
2023-09-07 18:36:16 +08:00
Obx(() {
var titleStr = "";
2023-11-01 17:28:59 +08:00
if ((state.lockSettingInfo.value.lockSound ?? 0) == 1) {
switch (
state.lockSettingInfo.value.lockSoundVolume ?? 0) {
2023-09-07 18:36:16 +08:00
case 1:
titleStr = TranslationLoader.lanKeys!.low!.tr;
break;
case 2:
titleStr = TranslationLoader.lanKeys!.lower!.tr;
break;
case 3:
titleStr = TranslationLoader.lanKeys!.medium!.tr;
break;
case 4:
titleStr = TranslationLoader.lanKeys!.high!.tr;
break;
case 5:
titleStr = TranslationLoader.lanKeys!.higher!.tr;
break;
}
} else {
2023-09-07 18:36:16 +08:00
titleStr = TranslationLoader.lanKeys!.closed!.tr;
}
2023-10-07 18:55:59 +08:00
return Visibility(
visible: state.lockFeature.value.lockSound == 1
? true
: false,
2023-10-07 18:55:59 +08:00
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockSound!.tr,
rightTitle: titleStr,
isHaveLine: true,
isHaveDirection: true,
action: () {
2023-11-01 17:28:59 +08:00
Get.toNamed(Routers.lockSoundSetPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
}));
2023-09-07 18:36:16 +08:00
}),
2023-10-12 14:00:49 +08:00
// 防撬报警
2023-10-07 18:55:59 +08:00
Obx(() => Visibility(
visible: state.lockFeature.value.antiPrySwitch == 1
? true
: false,
2023-10-07 18:55:59 +08:00
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.burglarAlarm!.tr,
rightTitle:
(state.lockSettingInfo.value.antiPrySwitch ??
0) ==
1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
2023-11-01 17:28:59 +08:00
Get.toNamed(Routers.burglarAlarmPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
}))),
2023-10-07 18:55:59 +08:00
SizedBox(height: 10.h),
2023-10-12 14:00:49 +08:00
// 常开模式
2023-10-07 18:55:59 +08:00
Obx(() => Visibility(
2023-11-13 09:47:19 +08:00
visible: state.lockFeature.value.passageMode == 1
? true
: false,
// visible:true,
2023-10-07 18:55:59 +08:00
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
rightTitle:
(state.lockSettingInfo.value.passageMode ?? 0) ==
1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.normallyOpenModePage,
arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
}))),
2023-10-12 14:00:49 +08:00
// 远程开锁
2023-10-07 18:55:59 +08:00
Obx(() => Visibility(
visible: state.lockFeature.value.remoteUnlock == 1
? true
: false,
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.remoteUnlocking!.tr,
rightTitle:
(state.lockSettingInfo.value.remoteUnlock ?? 0) ==
1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.remoteUnlockingPage,
arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
}))),
2023-10-12 14:00:49 +08:00
// 重置键
2023-10-07 18:55:59 +08:00
Obx(() => Visibility(
visible: state.lockFeature.value.resetSwitch == 1
? true
: false,
2023-10-07 18:55:59 +08:00
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
rightTitle:
(state.lockSettingInfo.value.resetSwitch ?? 0) ==
1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
2023-11-01 17:28:59 +08:00
Get.toNamed(Routers.resetButtonPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
}))),
2023-10-07 18:55:59 +08:00
SizedBox(height: 10.h),
//---田总新增展示
2023-10-07 18:55:59 +08:00
// Obx(() =>
Visibility(
2023-10-07 18:55:59 +08:00
visible: true,
child: CommonItem(
leftTitel: '面容开锁',
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.faceUnlockPage);
})),
2023-10-07 18:55:59 +08:00
// ),
Visibility(
visible: true,
child: CommonItem(
2023-11-13 09:47:19 +08:00
leftTitel: '消息提醒',
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.msgNotificationPage);
})),
Visibility(
2023-10-07 18:55:59 +08:00
visible: true,
child: CommonItem(
2023-11-13 09:47:19 +08:00
leftTitel: '猫眼设置',
2023-10-07 18:55:59 +08:00
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
2023-11-13 09:47:19 +08:00
Get.toNamed(Routers.catEyeSetPage);
})),
// Obx(() =>
//自动亮屏已包括至面容开锁模块
// Visibility(
// visible: true,
// child: CommonItem(
// leftTitel: '自动亮屏',
// rightTitle: "",
// isHaveLine: true,
// isHaveDirection: true,
// action: () {})),
2023-10-07 18:55:59 +08:00
// ),
2023-10-07 18:55:59 +08:00
// Obx(() =>
//感应距离已包括至面容开锁模块
// Visibility(
// visible: true,
// child: CommonItem(
// leftTitel: '感应距离',
// rightTitle: "",
// isHaveLine: true,
// isHaveDirection: true,
// action: () {
// Toast.show(msg: "功能暂未开放");
// })),
2023-10-07 18:55:59 +08:00
// ),
// Obx(() =>
Visibility(
2023-10-07 18:55:59 +08:00
visible: true,
child: CommonItem(
leftTitel: '开门方向设置',
2023-10-07 18:55:59 +08:00
rightTitle: "",
isHaveDirection: true,
2023-10-07 18:55:59 +08:00
isHaveLine: true,
action: () {
// Toast.show(msg: "功能暂未开放");
Get.toNamed(Routers.openDoorDirectionPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
})),
2023-10-07 18:55:59 +08:00
// ),
// Obx(() =>
Visibility(
2023-10-07 18:55:59 +08:00
visible: true,
child: CommonItem(
leftTitel: '电机功率设置',
2023-10-07 18:55:59 +08:00
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
// Toast.show(msg: "功能暂未开放");
Get.toNamed(Routers.motorPowerPage);
})),
// 支持蓝牙广播(关闭则不能使用蓝牙主动开锁)
Obx(() => Visibility(
2023-10-07 18:55:59 +08:00
visible: true,
child: CommonItem(
leftTitel: '蓝牙广播',
2023-10-12 14:00:49 +08:00
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: _lockBlueBroadcastSwitch()))),
2023-10-07 18:55:59 +08:00
SizedBox(height: 10.h),
//-----新增至此
2023-11-01 17:28:59 +08:00
// 标记房态
Obx(() {
var title = "";
if (state.lockStatus.value.roomStatus == 1) {
title = TranslationLoader.lanKeys!.checkedIn!.tr;
} else if (state.lockStatus.value.roomStatus == 0) {
title = TranslationLoader.lanKeys!.leisure!.tr;
}
2023-10-07 18:55:59 +08:00
return Visibility(
2023-11-13 09:47:19 +08:00
visible: state.lockStatus.value.roomStatus == 1
? true
: false,
2023-10-07 18:55:59 +08:00
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.markedHouseState!.tr,
2023-10-07 18:55:59 +08:00
rightTitle: title,
isHaveLine: true,
isHaveDirection: true,
action: () {
2023-11-13 09:47:19 +08:00
Get.toNamed(Routers.markedHouseStatePage,
arguments: {
'lockSetInfoData':
state.lockSetInfoData.value
});
}));
}),
2023-11-01 17:28:59 +08:00
// 考勤
Obx(
() => Visibility(
visible: state.lockFeature.value.attendance == 1
? true
: false,
2023-11-01 17:28:59 +08:00
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.checkingIn!.tr,
2023-11-01 17:28:59 +08:00
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: _openCheckInSwitch())),
2023-11-01 17:28:59 +08:00
),
// 开锁提醒
Obx(
() => Visibility(
visible: state.lockFeature.value.unlockReminder == 1 ? true : false,
2023-11-01 17:28:59 +08:00
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
2023-11-01 17:28:59 +08:00
rightTitle: "",
isHaveLine: false,
isHaveRightWidget: true,
rightWidget: _lockRemindSwitch())),
2023-11-01 17:28:59 +08:00
),
2023-10-07 18:55:59 +08:00
SizedBox(height: 10.h),
2023-11-01 17:28:59 +08:00
// wifi配网
Obx(
() => Visibility(
visible:
state.lockFeature.value.wifi == 1 ? true : false,
2023-11-18 10:38:13 +08:00
child:
CommonItem(
leftTitel: TranslationLoader.lanKeys!.wifiDistributionNetwork!.tr,
2023-11-01 17:28:59 +08:00
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
2023-11-18 10:38:13 +08:00
Get.toNamed(Routers.configuringWifiPage,
arguments: {
'lockSetInfoData':
state.lockSetInfoData.value
});
})
),
2023-11-01 17:28:59 +08:00
),
2023-10-07 18:55:59 +08:00
// Obx(() =>
2023-11-01 17:28:59 +08:00
// 锁时间
Visibility(
visible: true,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockTime!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.lockTimePage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
})),
2023-10-07 18:55:59 +08:00
// ),
// Obx(() =>
2023-11-01 17:28:59 +08:00
// 诊断
Visibility(
visible: true,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.diagnose!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.diagnosePage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
})),
2023-10-07 18:55:59 +08:00
// ),
// Obx(() =>
2023-11-01 17:28:59 +08:00
// 上传数据
Visibility(
visible: true,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.uploadData!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.uploadDataPage);
})),
2023-10-07 18:55:59 +08:00
// ),
// Obx(() =>
2023-10-25 16:18:27 +08:00
// Visibility(
// visible: true,
// child: CommonItem(
// leftTitel: TranslationLoader
// .lanKeys!.importOtherLockData!.tr,
// rightTitle: "",
// isHaveLine: true,
// isHaveDirection: true,
// action: () {
// Get.toNamed(Routers.importOtherLockDataPage);
// })),
2023-10-07 18:55:59 +08:00
// ),
// Obx(() =>
2023-11-01 17:28:59 +08:00
// 锁升级
Visibility(
visible: true,
child: CommonItem(
leftTitel:
TranslationLoader.lanKeys!.lockEscalation!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.lockEscalationPage);
})),
2023-10-07 18:55:59 +08:00
// ),
SizedBox(height: 30.h),
Container(
padding:
EdgeInsets.only(left: 20.w, right: 20.w, bottom: 30.h),
child: SubmitBtn(
btnName: TranslationLoader.lanKeys!.delete!.tr,
isDelete: true,
onClick: () {
2023-09-28 18:05:23 +08:00
// logic.deletUserAction();
2023-10-17 15:49:09 +08:00
// logic.deletLockInfoData();
showDeletAlertDialog(context);
2023-10-17 16:01:06 +08:00
// showDeletPasswordAlertDialog(context);
}),
2023-07-10 17:50:31 +08:00
),
],
),
),
],
));
2023-07-10 17:50:31 +08:00
}
Widget rightText(String rightTitle) {
return Text(rightTitle ?? "",
textAlign: TextAlign.end,
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor));
2023-11-01 17:28:59 +08:00
}
CupertinoSwitch _openCheckInSwitch() {
// print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: ((state.isAttendance.value) == 1) ? true : false,
onChanged: (value) {
2023-11-13 09:47:19 +08:00
logic.openCheckingInData((checkingInInfoDataEntity) {
if (checkingInInfoDataEntity.data!.companyId == 0) {
showCupertinoAlertDialog(context);
} else {
logic.setLockSetGeneralSetting();
}
});
},
2023-07-10 17:50:31 +08:00
);
}
CupertinoSwitch _lockRemindSwitch() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: (state.isLockPickingReminder.value) == 1 ? true : false,
onChanged: (value) {
setState(() {
logic.setLockPickingReminder();
});
},
2023-07-10 17:50:31 +08:00
);
}
// 异常警告
CupertinoSwitch _lockExceptionWarningsSwitch() {
print("isOpenBlueBroadcast222:${state.isOpenExceptionWarnings.value}");
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: (state.isOpenExceptionWarnings.value) == 1 ? true : false,
onChanged: (value) {
setState(() {
logic.sendBurglarAlarm(62);
});
},
);
}
// 逗留警告
CupertinoSwitch _lockStayWarnSwitch() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: (state.isOpenExceptionWarnings.value) == 1 ? true : false,
onChanged: (value) {
setState(() {
logic.sendBurglarAlarm(61);
});
},
);
}
// 支持蓝牙广播
CupertinoSwitch _lockBlueBroadcastSwitch() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: (state.isOpenBlueBroadcast.value) == 1 ? true : false,
onChanged: (value) {
setState(() {
logic.sendBurglarAlarm(56);
});
},
);
}
2023-10-12 14:00:49 +08:00
CupertinoSwitch _otherUnHaveDoneSwitch() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: false,
onChanged: (value) {
Toast.show(msg: "功能暂未开放");
},
);
}
//确认弹窗
void showCupertinoAlertDialog(widgetContext) {
showCupertinoDialog(
context: widgetContext,
builder: (context) {
return CupertinoAlertDialog(
2023-10-19 09:25:35 +08:00
title: const Text("提示"),
content: const Text('创建公司号,考勤功能才能使用'),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Navigator.of(context).pop();
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Navigator.pop(context);
2023-11-01 17:28:59 +08:00
Get.toNamed(Routers.checkInCreatCompanyPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
},
),
],
2023-10-17 15:49:09 +08:00
);
},
);
}
void showDeletAlertDialog(
BuildContext context,
) {
2023-10-19 09:25:35 +08:00
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return ShowIosTipView(
// title: "提示",
// tipTitle: "删除锁后,所有信息都会一起删除,确定删除锁吗?",
// sureClick: () {
// Navigator.pop(context);
// showDeletPasswordAlertDialog(context);
// },
// cancelClick: () {
// Navigator.pop(context);
// },
// );
// },
// );
showCupertinoDialog(
context: context,
2023-10-19 09:25:35 +08:00
builder: (context) {
return CupertinoAlertDialog(
title: const Text("提示"),
content: const Text('删除锁后,所有信息都会一起删除,确定删除锁吗?'),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Navigator.pop(context);
showDeletPasswordAlertDialog(context);
},
),
],
);
},
);
}
// void showCupertinoAlertDialog(
// BuildContext context,
// ) {
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return ShowIosTipView(
// title: "提示",
// tipTitle: "创建公司号,考勤功能才能使用",
// sureClick: () {
// //
// Navigator.pop(context);
// Get.toNamed(Routers.checkInCreatCompanyPage,
// arguments: state.getKeyInfosData.value);
// },
// cancelClick: () {
// Navigator.pop(context);
// },
// );
// },
// );
// }
2023-10-17 15:49:09 +08:00
void showDeletPasswordAlertDialog(
BuildContext context,
) {
2023-10-17 15:49:09 +08:00
showDialog(
context: context,
builder: (BuildContext context) {
return ShowTFView(
title: "请输入登录密码",
tipTitle: "",
controller: state.passwordTF,
sureClick: () {
//发送删除锁请求
if (state.passwordTF.text.isEmpty) {
Toast.show(msg: "请输入登录密码");
return;
2023-10-17 15:49:09 +08:00
}
logic.checkLoginPassword(() {
Navigator.pop(context);
});
2023-10-17 15:49:09 +08:00
},
cancelClick: () {
Navigator.pop(context);
},
);
},
);
}
@override
void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies();
/// 路由订阅
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}
@override
void dispose() {
// TODO: implement dispose
/// 取消路由订阅
AppRouteObserver().routeObserver.unsubscribe(this);
super.dispose();
}
/// 界面从上一个界面进入 当前界面即将出现
@override
void didPush() {
print("lockSet===didPush");
}
/// 界面返回上一个界面 当前界面即将消失
@override
void didPop() {
print("lockSet===didPop");
}
/// 当前界面从下一级返回 当前界面即将出现
@override
void didPopNext() {
print("lockSet===didPopNext");
}
/// 当前界面进入下一个界面 当前界面即将消失
@override
void didPushNext() {
print("lockSet===didPushNext");
}
2023-07-10 17:50:31 +08:00
}