2023-10-07 18:55:59 +08:00

75 lines
2.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_logic.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class RemoteUnlockingPage extends StatefulWidget {
const RemoteUnlockingPage({Key? key}) : super(key: key);
@override
State<RemoteUnlockingPage> createState() => _RemoteUnlockingPageState();
}
class _RemoteUnlockingPageState extends State<RemoteUnlockingPage> {
final logic = Get.put(RemoteUnlockingLogic());
final state = Get.find<RemoteUnlockingLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.remoteUnlocking!.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!.remoteUnlockingPageTip!.tr,
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
)),
],
),
SizedBox(
height: 20.h,
),
Obx((){
// print("state.remoteEnable:${state.remoteEnable}");
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Text(
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.remoteEnable.value == 1 ?TranslationLoader.lanKeys!.opened!.tr: TranslationLoader.lanKeys!.closed!.tr}",
style:
TextStyle(fontWeight: FontWeight.w600, fontSize: 22.sp),
)),
],
);
}),
SizedBox(
height: 40.h,
),
Obx(() => SubmitBtn(
btnName: state.remoteEnable.value == 1 ?TranslationLoader.lanKeys!.close!.tr: TranslationLoader.lanKeys!.open!.tr,
onClick: () {
logic.sendBurglarAlarm();
})),
],
),
));
}
}