71 lines
2.4 KiB
Dart
71 lines
2.4 KiB
Dart
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/mine/minePersonInfo/minePersonInfoEditName/MinePersonInfoEditName_logic.dart';
|
|
import 'package:star_lock/tools/toast.dart';
|
|
|
|
import '../../../app_settings/app_colors.dart';
|
|
import '../../../tools/tf_loginInput.dart';
|
|
import '../../../tools/titleAppBar.dart';
|
|
import '../../../translations/trans_lib.dart';
|
|
|
|
class MinePersonInfoEditNamePage extends StatefulWidget {
|
|
const MinePersonInfoEditNamePage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<MinePersonInfoEditNamePage> createState() =>
|
|
_MinePersonInfoEditNamePageState();
|
|
}
|
|
|
|
class _MinePersonInfoEditNamePageState
|
|
extends State<MinePersonInfoEditNamePage> {
|
|
final logic = Get.put(MinePersonInfoEditNameLogic());
|
|
final state = Get.find<MinePersonInfoEditNameLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.white,
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.changeNickName!.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor,
|
|
actionsList: [
|
|
TextButton(
|
|
child: Text(
|
|
TranslationLoader.lanKeys!.save!.tr,
|
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
|
),
|
|
onPressed: () {
|
|
if (state.nickNameIsOK == false) {
|
|
Toast.show(msg: '请输入昵称');
|
|
} else {
|
|
logic.updateUserInfoRequest();
|
|
}
|
|
},
|
|
),
|
|
],
|
|
),
|
|
body: Container(
|
|
padding: EdgeInsets.all(15.w),
|
|
child: Column(
|
|
children: [
|
|
LoginInput(
|
|
controller: state.nickNameController,
|
|
onchangeAction: (textStr) {
|
|
logic.checkNext(state.nickNameController);
|
|
},
|
|
isPwd: false,
|
|
leftWidget: SizedBox(width: 15.w),
|
|
hintText:
|
|
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.nickName!.tr}",
|
|
inputFormatters: [
|
|
LengthLimitingTextInputFormatter(20),
|
|
]),
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|