2023-07-18 18:10:57 +08:00
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
import 'package:get/get.dart';
|
2023-10-11 18:24:52 +08:00
|
|
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/mineUnbindPhoneOrEmail_logic.dart';
|
2023-10-09 18:45:10 +08:00
|
|
|
|
import 'package:star_lock/tools/tf_input_haveBorder.dart';
|
2023-07-18 18:10:57 +08:00
|
|
|
|
|
|
|
|
|
|
import '../../../../appRouters.dart';
|
|
|
|
|
|
import '../../../../app_settings/app_colors.dart';
|
|
|
|
|
|
import '../../../../tools/submitBtn.dart';
|
|
|
|
|
|
import '../../../../tools/titleAppBar.dart';
|
|
|
|
|
|
import '../../../../translations/trans_lib.dart';
|
|
|
|
|
|
|
2023-10-11 18:24:52 +08:00
|
|
|
|
class MineUnbindPhoneOrEmailPage extends StatefulWidget {
|
|
|
|
|
|
const MineUnbindPhoneOrEmailPage({Key? key}) : super(key: key);
|
2023-07-18 18:10:57 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
2023-10-11 18:24:52 +08:00
|
|
|
|
State<MineUnbindPhoneOrEmailPage> createState() =>
|
|
|
|
|
|
_MineUnbindPhoneOrEmailState();
|
2023-07-18 18:10:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-11 18:24:52 +08:00
|
|
|
|
class _MineUnbindPhoneOrEmailState extends State<MineUnbindPhoneOrEmailPage> {
|
|
|
|
|
|
final logic = Get.put(MineUnbindPhoneOrEmailLogic());
|
|
|
|
|
|
final state = Get.find<MineUnbindPhoneOrEmailLogic>().state;
|
2023-07-18 18:10:57 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
2023-07-27 15:26:30 +08:00
|
|
|
|
appBar: TitleAppBar(
|
|
|
|
|
|
barTitle: TranslationLoader.lanKeys!.modifyAccount!.tr,
|
|
|
|
|
|
haveBack: true,
|
|
|
|
|
|
backgroundColor: AppColors.mainColor),
|
|
|
|
|
|
body: Column(
|
2023-07-18 18:10:57 +08:00
|
|
|
|
children: [
|
|
|
|
|
|
Container(
|
2023-07-27 15:26:30 +08:00
|
|
|
|
width: 1.sw,
|
|
|
|
|
|
color: AppColors.greyBackgroundColor,
|
|
|
|
|
|
padding: EdgeInsets.only(left: 15.w, top: 10.h, bottom: 10.h),
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
TranslationLoader.lanKeys!.modifyAccountTip!.tr,
|
|
|
|
|
|
style: TextStyle(fontSize: 20.sp),
|
|
|
|
|
|
)),
|
2023-10-09 18:45:10 +08:00
|
|
|
|
Obx(() => Container(
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
left: 30.w, right: 30.w, top: 20.h, bottom: 10.h),
|
|
|
|
|
|
child: TFInputHaveBorder(
|
|
|
|
|
|
controller: state.codeController,
|
2023-10-11 18:24:52 +08:00
|
|
|
|
onChangeAction: () {
|
|
|
|
|
|
logic.checkNext(state.codeController);
|
|
|
|
|
|
},
|
2023-10-09 18:45:10 +08:00
|
|
|
|
label:
|
|
|
|
|
|
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
|
|
|
|
|
|
rightSlot: GestureDetector(
|
2024-03-28 13:46:35 +08:00
|
|
|
|
onTap: state.canResend.value ?() {
|
|
|
|
|
|
logic.sendValidationCode();
|
|
|
|
|
|
} : null,
|
2023-10-09 18:45:10 +08:00
|
|
|
|
child: Container(
|
|
|
|
|
|
width: 180.w,
|
|
|
|
|
|
height: 90.h,
|
|
|
|
|
|
padding: EdgeInsets.all(5.h),
|
|
|
|
|
|
margin: EdgeInsets.only(right: 10.w),
|
|
|
|
|
|
child: Center(
|
|
|
|
|
|
child: Text(state.btnText.value,
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
color: AppColors.mainColor,
|
|
|
|
|
|
fontSize: 26.sp,
|
|
|
|
|
|
)),
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
)))),
|
2023-07-18 18:10:57 +08:00
|
|
|
|
SizedBox(height: 50.w),
|
2023-10-11 18:24:52 +08:00
|
|
|
|
Obx(() => SubmitBtn(
|
2023-07-27 15:26:30 +08:00
|
|
|
|
btnName: TranslationLoader.lanKeys!.next!.tr,
|
2023-10-11 18:24:52 +08:00
|
|
|
|
isDisabled: state.canSub.value,
|
2023-07-27 15:26:30 +08:00
|
|
|
|
onClick: () {
|
2023-10-11 18:24:52 +08:00
|
|
|
|
if (state.channel.value == '1') {
|
|
|
|
|
|
logic.unbindPhoneTokenRequest();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
logic.unbindEmailTokenRequest();
|
|
|
|
|
|
}
|
|
|
|
|
|
})),
|
2023-07-18 18:10:57 +08:00
|
|
|
|
SizedBox(height: 50.w),
|
|
|
|
|
|
Row(
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
|
children: [
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
|
// width: 150.w,
|
|
|
|
|
|
height: 50.h,
|
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
|
child: Center(
|
2023-07-27 15:26:30 +08:00
|
|
|
|
child: Text(
|
|
|
|
|
|
'${TranslationLoader.lanKeys!.forgetPassword!.tr}?',
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
fontSize: 18.sp, color: AppColors.mainColor)),
|
2023-07-18 18:10:57 +08:00
|
|
|
|
),
|
|
|
|
|
|
),
|
2023-07-27 15:26:30 +08:00
|
|
|
|
onTap: () {
|
|
|
|
|
|
Navigator.pushNamed(
|
|
|
|
|
|
context, Routers.starLockForgetPasswordPage);
|
2023-07-18 18:10:57 +08:00
|
|
|
|
},
|
|
|
|
|
|
),
|
|
|
|
|
|
SizedBox(width: 30.w),
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
],
|
2023-07-27 15:26:30 +08:00
|
|
|
|
));
|
2023-07-18 18:10:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|