115 lines
3.8 KiB
Dart
Executable File
115 lines
3.8 KiB
Dart
Executable File
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:star_lock/flavors.dart';
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditName/MinePersonInfoEditName_logic.dart';
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditName/minePersonInfoEditName_state.dart';
|
|
|
|
import '../../../app_settings/app_colors.dart';
|
|
import '../../../tools/tf_loginInput.dart';
|
|
import '../../../tools/titleAppBar.dart';
|
|
|
|
class MinePersonInfoEditNamePage extends StatefulWidget {
|
|
const MinePersonInfoEditNamePage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<MinePersonInfoEditNamePage> createState() =>
|
|
_MinePersonInfoEditNamePageState();
|
|
}
|
|
|
|
class _MinePersonInfoEditNamePageState extends State<MinePersonInfoEditNamePage> {
|
|
final MinePersonInfoEditNameLogic logic = Get.put(MinePersonInfoEditNameLogic());
|
|
final MinePersonInfoEditNamePageState state = Get.find<MinePersonInfoEditNameLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.greyBackgroundColor,
|
|
appBar: F.sw(
|
|
skyCall: () => TitleAppBar(
|
|
barTitle: '修改昵称'.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor,
|
|
actionsList: <Widget>[
|
|
TextButton(
|
|
child: Text(
|
|
'保存'.tr,
|
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
|
),
|
|
onPressed: () {
|
|
if (state.nickNameIsOK == false) {
|
|
logic.showToast('请输入昵称'.tr);
|
|
} else {
|
|
logic.updateUserInfoRequest();
|
|
}
|
|
},
|
|
),
|
|
],
|
|
),
|
|
xhjCall: () => TitleAppBar(
|
|
barTitle: '修改昵称'.tr,
|
|
haveBack: true,
|
|
backgroundColor: Colors.white,
|
|
iconColor: AppColors.blackColor,
|
|
titleColor: AppColors.blackColor,
|
|
actionsList: <Widget>[
|
|
TextButton(
|
|
child: Text(
|
|
'保存'.tr,
|
|
style:
|
|
TextStyle(color: AppColors.blackColor, fontSize: 24.sp),
|
|
),
|
|
onPressed: () {
|
|
if (state.nickNameIsOK == false) {
|
|
logic.showToast('请输入昵称'.tr);
|
|
} else {
|
|
logic.updateUserInfoRequest();
|
|
}
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
body: Container(
|
|
padding: EdgeInsets.all(15.w),
|
|
child: listView(),
|
|
));
|
|
}
|
|
|
|
Widget listView() {
|
|
Widget view = Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: <Widget>[
|
|
LoginInput(
|
|
controller: state.nickNameController,
|
|
onchangeAction: (textStr) {
|
|
logic.checkNext(state.nickNameController);
|
|
},
|
|
isPwd: false,
|
|
leftWidget: SizedBox(width: 15.w),
|
|
hintText:
|
|
'请输入昵称'.tr,
|
|
inputFormatters: <TextInputFormatter>[
|
|
LengthLimitingTextInputFormatter(20),
|
|
]),
|
|
],
|
|
);
|
|
view = F.sw(
|
|
skyCall: () => view,
|
|
xhjCall: () => Container(
|
|
margin: EdgeInsets.only(top: 20.h, left: 16.w, right: 16.w),
|
|
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.all(Radius.circular(20.r))),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(20.r),
|
|
child: view,
|
|
),
|
|
));
|
|
return view;
|
|
}
|
|
}
|