75 lines
2.6 KiB
Dart
75 lines
2.6 KiB
Dart
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';
|
|
import 'burglarAlarm_logic.dart';
|
|
|
|
class BurglarAlarmPage extends StatefulWidget {
|
|
const BurglarAlarmPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<BurglarAlarmPage> createState() => _BurglarAlarmPageState();
|
|
}
|
|
|
|
class _BurglarAlarmPageState extends State<BurglarAlarmPage> {
|
|
final logic = Get.put(BurglarAlarmLogic());
|
|
final state = Get.find<BurglarAlarmLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.white,
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor),
|
|
body: Container(
|
|
padding: EdgeInsets.all(30.w),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
child: Text(
|
|
TranslationLoader.lanKeys!.burglarAlarmTip!.tr,
|
|
style: TextStyle(fontSize: 20.sp),
|
|
)),
|
|
],
|
|
),
|
|
SizedBox(
|
|
height: 20.h,
|
|
),
|
|
Obx(() => Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
child: Text(
|
|
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.burglarAlarmEnable.value == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr}",
|
|
style:
|
|
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600),
|
|
)),
|
|
],
|
|
)),
|
|
SizedBox(
|
|
height: 40.h,
|
|
),
|
|
Obx(() => SubmitBtn(
|
|
btnName: state.burglarAlarmEnable.value == 1 ? TranslationLoader.lanKeys!.close!.tr : TranslationLoader.lanKeys!.open!.tr,
|
|
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),
|
|
onClick: () {
|
|
logic.sendBurglarAlarm();
|
|
})),
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|