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 createState() => _DemoModeLockSetPageState(); } class _DemoModeLockSetPageState extends State { @override void initState() { // TODO: implement initState super.initState(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( barTitle: TranslationLoader.lanKeys!.set!.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( children: [ Expanded( child: ListView( children: [ // 基本信息 CommonItem( leftTitel: TranslationLoader.lanKeys!.basicInformation!.tr, rightTitle: "", isHaveLine: false, isHaveDirection: true, action: () { gotoAddLock(); // Get.toNamed(Routers.basicInformationPage, arguments: { // 'keyInfo': state.getKeyInfosData.value // }); }), SizedBox( height: 10.h, ), // 门磁 CommonItem( leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); // Get.toNamed(Routers.doorMagneticPage); // Toast.show(msg: "功能暂未开放"); }), // 无线键盘 CommonItem( leftTitel: TranslationLoader.lanKeys!.wirelessKeyboard!.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: TranslationLoader.lanKeys!.automaticBlocking!.tr, rightTitle: TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); // Get.toNamed(Routers.automaticBlockingPage, // arguments: state.getKeyInfosData.value); }), // 锁声音 CommonItem( leftTitel: TranslationLoader.lanKeys!.lockSound!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); // Get.toNamed(Routers.lockSoundSetPage, arguments: state.getKeyInfosData.value); }), // 防撬报警 CommonItem( leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr, rightTitle: TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); // Get.toNamed(Routers.burglarAlarmPage, // arguments: state.getKeyInfosData.value); }), SizedBox(height: 10.h), // 常开模式 CommonItem( leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, rightTitle: TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); // Get.toNamed(Routers.normallyOpenModePage, arguments: state.getKeyInfosData.value); }), // 远程开锁 CommonItem( leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr, rightTitle: TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); // Get.toNamed(Routers.remoteUnlockingPage, // arguments: state.getKeyInfosData.value); }), // 重置键 CommonItem( leftTitel: TranslationLoader.lanKeys!.resetButton!.tr, rightTitle: TranslationLoader.lanKeys!.closed!.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: TranslationLoader.lanKeys!.checkingIn!.tr, rightTitle: "", isHaveLine: true, isHaveRightWidget: true, rightWidget: _openCheckInSwitch()), // 开锁提醒 CommonItem( leftTitel: TranslationLoader.lanKeys!.unlockReminder!.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: TranslationLoader.lanKeys!.lockTime!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); }), // 诊断 CommonItem( leftTitel: TranslationLoader.lanKeys!.diagnose!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); }), // 上传数据 CommonItem( leftTitel: TranslationLoader.lanKeys!.uploadData!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { gotoAddLock(); }), // CommonItem( // leftTitel: // TranslationLoader.lanKeys!.importOtherLockData!.tr, // rightTitle: "", // isHaveLine: true, // isHaveDirection: true, // action: () { // gotoAddLock(); // }), // 锁升级 CommonItem( leftTitel: TranslationLoader.lanKeys!.lockEscalation!.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); } }