345 lines
13 KiB
Dart
Executable File
345 lines
13 KiB
Dart
Executable File
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../../app_settings/app_colors.dart';
|
|
import '../../../../tools/commonItem.dart';
|
|
import '../../../../tools/submitBtn.dart';
|
|
import '../../../../tools/titleAppBar.dart';
|
|
import '../../../../translations/trans_lib.dart';
|
|
|
|
class DemoModeLockSetPage extends StatefulWidget {
|
|
const DemoModeLockSetPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<DemoModeLockSetPage> createState() => _DemoModeLockSetPageState();
|
|
}
|
|
|
|
class _DemoModeLockSetPageState extends State<DemoModeLockSetPage> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
appBar: TitleAppBar(
|
|
barTitle: '设置'.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor),
|
|
body: Column(
|
|
children: [
|
|
Expanded(
|
|
child: ListView(
|
|
children: [
|
|
// 基本信息
|
|
CommonItem(
|
|
leftTitel:'基本信息'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: false,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.basicInformationPage, arguments: {
|
|
// 'keyInfo': state.getKeyInfosData.value
|
|
// });
|
|
}),
|
|
SizedBox(
|
|
height: 10.h,
|
|
),
|
|
// 门磁
|
|
CommonItem(
|
|
leftTitel: '门磁'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.doorMagneticPage);
|
|
// Toast.show(msg: "功能暂未开放");
|
|
}),
|
|
// 无线键盘
|
|
CommonItem(
|
|
leftTitel:'无线键盘'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: false,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.wirelessKeyboardPage);
|
|
// Toast.show(msg: "功能暂未开放");
|
|
}),
|
|
// 照明
|
|
CommonItem(
|
|
leftTitel: '照明',
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
// 开门器
|
|
CommonItem(
|
|
leftTitel: '开门器',
|
|
rightTitle: '',
|
|
isHaveLine: false,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
SizedBox(height: 10.h),
|
|
// 自动闭锁
|
|
CommonItem(
|
|
leftTitel: '自动闭锁'.tr,
|
|
rightTitle: '已关闭'.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.automaticBlockingPage,
|
|
// arguments: state.getKeyInfosData.value);
|
|
}),
|
|
// 锁声音
|
|
CommonItem(
|
|
leftTitel: '锁声音'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.lockSoundSetPage, arguments: state.getKeyInfosData.value);
|
|
}),
|
|
// 防撬报警
|
|
CommonItem(
|
|
leftTitel: '防撬报警'.tr,
|
|
rightTitle: '已关闭'.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.burglarAlarmPage,
|
|
// arguments: state.getKeyInfosData.value);
|
|
}),
|
|
SizedBox(height: 10.h),
|
|
// 常开模式
|
|
CommonItem(
|
|
leftTitel:'常开模式'.tr,
|
|
rightTitle: '已关闭'.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.normallyOpenModePage, arguments: state.getKeyInfosData.value);
|
|
}),
|
|
// 远程开锁
|
|
CommonItem(
|
|
leftTitel: '远程开锁'.tr,
|
|
rightTitle: '已关闭'.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.remoteUnlockingPage,
|
|
// arguments: state.getKeyInfosData.value);
|
|
}),
|
|
// 重置键
|
|
CommonItem(
|
|
leftTitel: '重置键'.tr,
|
|
rightTitle: '已关闭'.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
// Get.toNamed(Routers.resetButtonPage,
|
|
// arguments: state.getKeyInfosData.value);
|
|
}),
|
|
SizedBox(height: 10.h),
|
|
//---田总新增展示
|
|
CommonItem(
|
|
leftTitel: '面容开锁',
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
CommonItem(
|
|
leftTitel: '消息提醒',
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
CommonItem(
|
|
leftTitel: '猫眼设置',
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
CommonItem(
|
|
leftTitel: '开门方向设置',
|
|
rightTitle: '',
|
|
isHaveDirection: true,
|
|
isHaveLine: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
CommonItem(
|
|
leftTitel: '电机功率设置',
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
// 支持蓝牙广播(关闭则不能使用蓝牙主动开锁)
|
|
CommonItem(
|
|
leftTitel: '蓝牙广播',
|
|
rightTitle: '',
|
|
isHaveLine: false,
|
|
isHaveRightWidget: true,
|
|
rightWidget: _lockRemindSwitch()),
|
|
// ),
|
|
SizedBox(height: 10.h),
|
|
//-----新增至此
|
|
// 标记房态
|
|
// CommonItem(
|
|
// leftTitel:
|
|
// TranslationLoader.lanKeys!.markedHouseState!.tr,
|
|
// rightTitle: "",
|
|
// isHaveLine: true,
|
|
// isHaveDirection: true,
|
|
// action: () {
|
|
// gotoAddLock();
|
|
// }),
|
|
// 考勤
|
|
CommonItem(
|
|
leftTitel: '考勤'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveRightWidget: true,
|
|
rightWidget: _openCheckInSwitch()),
|
|
// 开锁提醒
|
|
CommonItem(
|
|
leftTitel: '开锁提醒'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: false,
|
|
isHaveRightWidget: true,
|
|
rightWidget: _lockRemindSwitch()),
|
|
CommonItem(
|
|
leftTitel: '开锁时是否需联网',
|
|
rightTitle: '',
|
|
isHaveLine: false,
|
|
isHaveRightWidget: true,
|
|
rightWidget: _lockRemindSwitch()),
|
|
SizedBox(height: 10.h),
|
|
// wifi配网
|
|
CommonItem(
|
|
leftTitel: TranslationLoader
|
|
.lanKeys!.wifiDistributionNetwork!.tr,
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
// 锁时间
|
|
CommonItem(
|
|
leftTitel: '锁时间'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
// 诊断
|
|
CommonItem(
|
|
leftTitel: '诊断'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
// 上传数据
|
|
CommonItem(
|
|
leftTitel: '上传数据'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
// CommonItem(
|
|
// leftTitel:
|
|
// TranslationLoader.lanKeys!.importOtherLockData!.tr,
|
|
// rightTitle: "",
|
|
// isHaveLine: true,
|
|
// isHaveDirection: true,
|
|
// action: () {
|
|
// gotoAddLock();
|
|
// }),
|
|
// 锁升级
|
|
CommonItem(
|
|
leftTitel: '锁升级'.tr,
|
|
rightTitle: '',
|
|
isHaveLine: false,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
gotoAddLock();
|
|
}),
|
|
SizedBox(height: 30.h),
|
|
Container(
|
|
padding:
|
|
EdgeInsets.only(left: 20.w, right: 20.w, bottom: 30.h),
|
|
child: SubmitBtn(
|
|
btnName: '退出演示模式',
|
|
isDelete: true,
|
|
onClick: () {
|
|
Get.close(2);
|
|
}),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
));
|
|
}
|
|
|
|
CupertinoSwitch _openCheckInSwitch() {
|
|
return CupertinoSwitch(
|
|
activeColor: CupertinoColors.activeBlue,
|
|
trackColor: CupertinoColors.systemGrey5,
|
|
thumbColor: CupertinoColors.white,
|
|
value: false,
|
|
onChanged: (value) {
|
|
gotoAddLock();
|
|
},
|
|
);
|
|
}
|
|
|
|
CupertinoSwitch _lockRemindSwitch() {
|
|
return CupertinoSwitch(
|
|
activeColor: CupertinoColors.activeBlue,
|
|
trackColor: CupertinoColors.systemGrey5,
|
|
thumbColor: CupertinoColors.white,
|
|
value: false,
|
|
onChanged: (value) {
|
|
gotoAddLock();
|
|
},
|
|
);
|
|
}
|
|
|
|
void gotoAddLock() {
|
|
// Get.toNamed(Routers.selectLockTypePage);
|
|
EasyLoading.showToast('演示模式', duration: 2000.milliseconds);
|
|
}
|
|
}
|