129 lines
5.1 KiB
Dart
129 lines
5.1 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/minePersonInfoEmail/minePersonInfoEmail_logic.dart';
|
|
|
|
import '../../../app_settings/app_colors.dart';
|
|
import '../../../tools/submitBtn.dart';
|
|
import '../../../tools/tf_loginInput.dart';
|
|
import '../../../tools/titleAppBar.dart';
|
|
import '../../../translations/trans_lib.dart';
|
|
|
|
class MinePersonInfoEditEmailPage extends StatefulWidget {
|
|
const MinePersonInfoEditEmailPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<MinePersonInfoEditEmailPage> createState() =>
|
|
_MinePersonInfoEditEmailPageState();
|
|
}
|
|
|
|
class _MinePersonInfoEditEmailPageState
|
|
extends State<MinePersonInfoEditEmailPage> {
|
|
final logic = Get.put(MinePersonInfoEmailLogic());
|
|
final state = Get.find<MinePersonInfoEmailLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.email!.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor),
|
|
body: Container(
|
|
padding: EdgeInsets.only(top: 10.h, left: 30.w, right: 30.w),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
width: 1.sw,
|
|
padding: EdgeInsets.only(top: 5.h, bottom: 5.h),
|
|
child: Text(
|
|
TranslationLoader.lanKeys!.changeEmailTip!.tr,
|
|
style: TextStyle(fontSize: 20.sp),
|
|
)),
|
|
LoginInput(
|
|
controller: state.accountController,
|
|
isPwd: false,
|
|
onchangeAction: (textStr) {
|
|
logic.checkNext(state.accountController);
|
|
},
|
|
leftWidget: const SizedBox(),
|
|
hintText:
|
|
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.email!.tr}",
|
|
inputFormatters: [
|
|
LengthLimitingTextInputFormatter(20),
|
|
]),
|
|
SizedBox(height: 10.w),
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: LoginInput(
|
|
controller: state.codeController,
|
|
isPwd: false,
|
|
leftWidget: const SizedBox(),
|
|
onchangeAction: (textStr) {
|
|
logic.checkNext(state.codeController);
|
|
},
|
|
hintText:
|
|
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
|
|
inputFormatters: [
|
|
LengthLimitingTextInputFormatter(20),
|
|
]),
|
|
),
|
|
SizedBox(
|
|
width: 20.w,
|
|
),
|
|
Obx(() => GestureDetector(
|
|
child: Container(
|
|
width: 180.w,
|
|
height: 60.h,
|
|
padding: EdgeInsets.all(5.h),
|
|
decoration: BoxDecoration(
|
|
color: state.accountIsOK.value
|
|
? AppColors.mainColor
|
|
: AppColors.btnDisableColor,
|
|
borderRadius: BorderRadius.circular(5)),
|
|
child: Center(
|
|
child: Text(state.btnText.value,
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 24.sp,
|
|
)),
|
|
),
|
|
),
|
|
onTap: () {
|
|
if (state.accountIsOK.value) {
|
|
logic.sendValidationCode();
|
|
}
|
|
},
|
|
))
|
|
],
|
|
),
|
|
SizedBox(height: 50.w),
|
|
Obx(() {
|
|
return SubmitBtn(
|
|
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
|
fontSize: 30.sp,
|
|
borderRadius: 20.w,
|
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
|
isDisabled: state.canSub.value,
|
|
onClick: state.canSub.value
|
|
? () {
|
|
if (state.accountIsOK.value && state.codeIsOK) {
|
|
if (state.channel.value == "1") {
|
|
logic.bindMobileRequest();
|
|
} else {
|
|
logic.bindEmailRequest();
|
|
}
|
|
}
|
|
}
|
|
: null);
|
|
}),
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|