import 'package:flutter/material.dart'; import 'package:flutter/services.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/showTFView.dart'; import '../../../tools/showTipView.dart'; import '../../../tools/submitBtn.dart'; import '../../../tools/titleAppBar.dart'; import 'gatewayDetail_logic.dart'; import 'gatewayDetail_state.dart'; class GatewayDetailPage extends StatefulWidget { const GatewayDetailPage({Key? key}) : super(key: key); @override State createState() => _GatewayDetailPageState(); } class _GatewayDetailPageState extends State { final GatewayDetailLogic logic = Get.put(GatewayDetailLogic()); final GatewayDetailState state = Get.find().state; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( barTitle: '网关'.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Obx(() => ListView( children: [ CommonItem( leftTitel: '名称'.tr, rightTitle: state.getewayItemData.value.gatewayName, isHaveLine: true, isHaveDirection: true, action: () { ShowTipView().showTFViewAlertDialog( state.changeGatewayNameController, '请输入姓名'.tr, '', () { if (state.changeGatewayNameController.text.isEmpty) { logic.showToast('请输入姓名'.tr); return; } // Get.back(); // state.typeName.value = state.changeNameController.text; // logic.editICCardData(); }, inputFormatters: [ FilteringTextInputFormatter.deny('\n'), LengthLimitingTextInputFormatter(50), ]); }), CommonItem( leftTitel: '状态'.tr, rightTitle: state.getewayItemData.value.isOnline == 1 ? '在线' : '离线', isHaveLine: true, isHaveDirection: false), CommonItem( leftTitel: 'WiFi名称'.tr, rightTitle: state.getewayItemData.value.networkName, isHaveLine: true, isHaveDirection: false), CommonItem( leftTitel: '网络MAC'.tr, rightTitle: state.getewayItemData.value.networkMac, isHaveLine: false, isHaveDirection: false), SizedBox( height: 10.h, ), CommonItem( leftTitel: '附近的锁'.tr, rightTitle: state.getewayItemData.value.lockNum.toString(), isHaveLine: true, isHaveDirection: true, action: () { Navigator.pushNamed(context, Routers.gatewayConnectionLockPage); }), CommonItem( leftTitel: '网关升级'.tr, rightTitle: '', isHaveLine: false, isHaveDirection: true, action: () {}), SizedBox( height: 80.h, ), SubmitBtn( btnName: '删除'.tr, isDelete: true, borderRadius: 20.w, fontSize: 32.sp, margin: EdgeInsets.only(left: 30.w, right: 30.w), padding: EdgeInsets.only(top: 15.w, bottom: 15.w), onClick: () { ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, logic.deletGateway); }), ], )), ); } }