88 lines
3.1 KiB
Dart
Raw Normal View History

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 '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
2023-09-07 18:36:16 +08:00
import 'resetButton_logic.dart';
2023-07-10 17:50:31 +08:00
class ResetButtonPage extends StatefulWidget {
2023-07-15 15:11:28 +08:00
const ResetButtonPage({Key? key}) : super(key: key);
2023-07-10 17:50:31 +08:00
@override
State<ResetButtonPage> createState() => _ResetButtonPageState();
}
class _ResetButtonPageState extends State<ResetButtonPage> {
2023-09-07 18:36:16 +08:00
final logic = Get.put(ResetButtonLogic());
final state = Get.find<ResetButtonLogic>().state;
2023-07-10 17:50:31 +08:00
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.resetButton!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Container(
2023-07-10 17:50:31 +08:00
padding: EdgeInsets.all(30.w),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationLoader.lanKeys!.resetButtonTip1!.tr,
style: TextStyle(fontSize: 20.sp),
),
SizedBox(
height: 10.h,
),
Text(
TranslationLoader.lanKeys!.resetButtonTip2!.tr,
style: TextStyle(fontSize: 20.sp),
)
],
)),
2023-07-10 17:50:31 +08:00
],
),
SizedBox(
height: 30.h,
),
2023-09-07 18:36:16 +08:00
Obx(() => Row(
2023-07-10 17:50:31 +08:00
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Text(
2023-09-07 18:36:16 +08:00
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.resetButtonEnable.value == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr}",
style:
TextStyle(fontWeight: FontWeight.w600, fontSize: 20.sp),
2023-09-07 18:36:16 +08:00
)),
2023-07-10 17:50:31 +08:00
],
2023-09-07 18:36:16 +08:00
)),
SizedBox(
height: 30.h,
),
2023-09-07 18:36:16 +08:00
Obx(() => SubmitBtn(
btnName: state.resetButtonEnable.value == 1 ? TranslationLoader.lanKeys!.close!.tr : TranslationLoader.lanKeys!.open!.tr,
2023-07-10 17:50:31 +08:00
borderRadius: 20.w,
fontSize: 32.sp,
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
2023-09-07 18:36:16 +08:00
onClick: () {
2023-10-07 18:55:59 +08:00
logic.sendBurglarAlarm();
2023-09-07 18:36:16 +08:00
})),
2023-07-10 17:50:31 +08:00
],
),
));
2023-07-10 17:50:31 +08:00
}
}