259 lines
10 KiB
Dart
259 lines
10 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
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/commonItem.dart';
|
|
import '../../../../tools/submitBtn.dart';
|
|
import '../../../../tools/titleAppBar.dart';
|
|
import '../../../../translations/trans_lib.dart';
|
|
import 'lockSet_logic.dart';
|
|
|
|
class LockSetPage extends StatefulWidget {
|
|
const LockSetPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<LockSetPage> createState() => _LockSetPageState();
|
|
}
|
|
|
|
class _LockSetPageState extends State<LockSetPage> {
|
|
final logic = Get.put(LockSetLogic());
|
|
final state = Get.find<LockSetLogic>().state;
|
|
|
|
@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: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.basicInformationPage);
|
|
}),
|
|
SizedBox(
|
|
height: 10.h,
|
|
),
|
|
CommonItem(
|
|
leftTitel:
|
|
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.wirelessKeyboardPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: false,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.doorMagneticPage);
|
|
}),
|
|
SizedBox(
|
|
height: 10.h,
|
|
),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
|
rightTitle: TranslationLoader.lanKeys!.closed!.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.remoteUnlockingPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel:
|
|
TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
|
rightTitle: "5s",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.automaticBlockingPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel:
|
|
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
|
rightTitle: TranslationLoader.lanKeys!.closed!.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.normallyOpenModePage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.lockSound!.tr,
|
|
rightTitle: "高",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.lockSoundSetPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
|
rightTitle: TranslationLoader.lanKeys!.opened!.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.burglarAlarmPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
|
|
rightTitle: TranslationLoader.lanKeys!.opened!.tr,
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.resetButtonPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.unlockQRCode!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.unlockQRCodePage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: 'WiFi配网',
|
|
rightTitle: "",
|
|
isHaveLine: false,
|
|
isHaveDirection: true,
|
|
action: () {}),
|
|
SizedBox(
|
|
height: 10.h,
|
|
),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.lockTime!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.lockTimePage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.diagnose!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.diagnosePage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.uploadData!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(context, Routers.uploadDataPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel:
|
|
TranslationLoader.lanKeys!.importOtherLockData!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.importOtherLockDataPage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.lockEscalation!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: false,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.lockEscalationPage);
|
|
}),
|
|
SizedBox(
|
|
height: 10.h,
|
|
),
|
|
CommonItem(
|
|
leftTitel: "Amazon Alexa",
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {}),
|
|
CommonItem(
|
|
leftTitel: "Google Home",
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {}),
|
|
SizedBox(
|
|
height: 10.h,
|
|
),
|
|
CommonItem(
|
|
leftTitel:
|
|
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
|
rightTitle: "空闲",
|
|
isHaveLine: true,
|
|
isHaveDirection: true,
|
|
action: () {
|
|
Navigator.pushNamed(
|
|
context, Routers.markedHouseStatePage);
|
|
}),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveRightWidget: true,
|
|
rightWidget: SizedBox(width: 60.w, child: _switch())),
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: false,
|
|
isHaveRightWidget: true,
|
|
rightWidget: SizedBox(width: 60.w, child: _switch())),
|
|
SizedBox(
|
|
height: 30.h,
|
|
),
|
|
Container(
|
|
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
|
child: SubmitBtn(
|
|
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
|
isDelete: true,
|
|
onClick: () {
|
|
logic.deletUserAction();
|
|
}),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
));
|
|
}
|
|
|
|
CupertinoSwitch _switch() {
|
|
bool _isOn = false;
|
|
return CupertinoSwitch(
|
|
activeColor: CupertinoColors.activeBlue,
|
|
trackColor: CupertinoColors.systemGrey5,
|
|
thumbColor: CupertinoColors.white,
|
|
value: _isOn,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_isOn = value;
|
|
});
|
|
},
|
|
);
|
|
}
|
|
}
|