93 lines
3.0 KiB
Dart
93 lines
3.0 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/commonItem.dart';
|
|
import '../../../../tools/submitBtn.dart';
|
|
import '../../../../tools/titleAppBar.dart';
|
|
import '../../../../translations/trans_lib.dart';
|
|
import 'configuringWifi_logic.dart';
|
|
|
|
class ConfiguringWifiPage extends StatefulWidget {
|
|
const ConfiguringWifiPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<ConfiguringWifiPage> createState() => _ConfiguringWifiPageState();
|
|
}
|
|
|
|
class _ConfiguringWifiPageState extends State<ConfiguringWifiPage> {
|
|
final logic = Get.put(ConfiguringWifiLogic());
|
|
final state = Get.find<ConfiguringWifiLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.white,
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.configuringWiFi!.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor),
|
|
body: Column(
|
|
children: [
|
|
configuringWifiTFWidget(TranslationLoader.lanKeys!.wifiName!.tr, TranslationLoader.lanKeys!.pleaseEnterWifiName!.tr, state.wifiNameController),
|
|
Container(width: 1.sw, height: 1.h,color: AppColors.mainBackgroundColor),
|
|
configuringWifiTFWidget(TranslationLoader.lanKeys!.wifiPassward!.tr, TranslationLoader.lanKeys!.pleaseEnterWifiPwd!.tr, state.wifiPWDController),
|
|
SizedBox(height: 50.h,),
|
|
SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () {
|
|
logic.senderConfiguringWifiAction();
|
|
}),
|
|
],
|
|
));
|
|
}
|
|
|
|
Widget configuringWifiTFWidget(
|
|
String titleStr, String rightTitle,TextEditingController controller) {
|
|
return Column(
|
|
children: [
|
|
Container(height: 10.h),
|
|
CommonItem(
|
|
leftTitel: titleStr,
|
|
rightTitle: "",
|
|
isHaveRightWidget: true,
|
|
rightWidget: getTFWidget(rightTitle, controller)),
|
|
Container(height: 10.h),
|
|
],
|
|
);
|
|
}
|
|
|
|
// 接受者信息输入框
|
|
Widget getTFWidget(String tfStr, TextEditingController controller) {
|
|
return Container(
|
|
height: 50.h,
|
|
width: 300.w,
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: TextField(
|
|
//输入框一行
|
|
maxLines: 1,
|
|
controller: controller,
|
|
autofocus: false,
|
|
textAlign: TextAlign.end,
|
|
decoration: InputDecoration(
|
|
//输入里面输入文字内边距设置
|
|
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
|
hintText: tfStr,
|
|
hintStyle: TextStyle(fontSize: 24.sp),
|
|
//不需要输入框下划线
|
|
border: InputBorder.none,
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: 10.w,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|