2023-07-18 18:10:57 +08:00
|
|
|
|
import 'package:flutter/material.dart';
|
2023-10-09 18:45:10 +08:00
|
|
|
|
import 'package:flutter/services.dart';
|
2023-07-18 18:10:57 +08:00
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
import 'package:get/get.dart';
|
2024-04-30 10:55:48 +08:00
|
|
|
|
import 'package:star_lock/flavors.dart';
|
2023-10-09 18:45:10 +08:00
|
|
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart';
|
2023-07-18 18:10:57 +08:00
|
|
|
|
|
|
|
|
|
|
import '../../../appRouters.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 MinePersonInfoResetPasswordPage extends StatefulWidget {
|
|
|
|
|
|
const MinePersonInfoResetPasswordPage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
2023-07-27 15:26:30 +08:00
|
|
|
|
State<MinePersonInfoResetPasswordPage> createState() =>
|
|
|
|
|
|
_MinePersonInfoResetPasswordPageState();
|
2023-07-18 18:10:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-07-27 15:26:30 +08:00
|
|
|
|
class _MinePersonInfoResetPasswordPageState
|
|
|
|
|
|
extends State<MinePersonInfoResetPasswordPage> {
|
2023-10-09 18:45:10 +08:00
|
|
|
|
final logic = Get.put(MinePersonInfoResetPasswordLogic());
|
|
|
|
|
|
final state = Get.find<MinePersonInfoResetPasswordLogic>().state;
|
2023-07-18 18:10:57 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
2024-04-30 10:55:48 +08:00
|
|
|
|
appBar: F.sw(
|
2024-05-28 10:40:17 +08:00
|
|
|
|
skyCall: () => TitleAppBar(
|
2023-07-27 15:26:30 +08:00
|
|
|
|
barTitle: TranslationLoader.lanKeys!.resetPasswords!.tr,
|
|
|
|
|
|
haveBack: true,
|
2024-04-30 10:55:48 +08:00
|
|
|
|
backgroundColor: AppColors.mainColor,
|
|
|
|
|
|
),
|
|
|
|
|
|
xhjCall: () => TitleAppBar(
|
|
|
|
|
|
barTitle: TranslationLoader.lanKeys!.resetPasswords!.tr,
|
|
|
|
|
|
haveBack: true,
|
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
|
iconColor: AppColors.blackColor,
|
|
|
|
|
|
titleColor: AppColors.blackColor,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
2023-07-27 15:26:30 +08:00
|
|
|
|
body: Container(
|
|
|
|
|
|
margin: EdgeInsets.only(left: 30.w, right: 30.w),
|
2023-07-18 18:10:57 +08:00
|
|
|
|
child: Column(
|
|
|
|
|
|
children: [
|
2024-04-30 10:55:48 +08:00
|
|
|
|
loginView(),
|
2023-07-18 18:10:57 +08:00
|
|
|
|
SizedBox(height: 50.w),
|
2023-10-09 18:45:10 +08:00
|
|
|
|
Obx(() => SubmitBtn(
|
2023-07-27 15:26:30 +08:00
|
|
|
|
btnName: TranslationLoader.lanKeys!.save!.tr,
|
|
|
|
|
|
fontSize: 30.sp,
|
|
|
|
|
|
borderRadius: 20.w,
|
2023-10-11 18:24:52 +08:00
|
|
|
|
isDisabled: state.canSub.value,
|
2023-07-27 15:26:30 +08:00
|
|
|
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
2023-10-11 18:24:52 +08:00
|
|
|
|
onClick: () {
|
|
|
|
|
|
logic.changePasswordRequest();
|
|
|
|
|
|
})),
|
2023-07-27 15:26:30 +08:00
|
|
|
|
SizedBox(height: 40.w),
|
2023-07-18 18:10:57 +08:00
|
|
|
|
Row(
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
children: [
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
|
// width: 150.w,
|
2024-04-16 17:44:38 +08:00
|
|
|
|
height: 60.h,
|
2023-07-18 18:10:57 +08:00
|
|
|
|
// color: Colors.red,
|
|
|
|
|
|
child: Center(
|
2023-07-27 15:26:30 +08:00
|
|
|
|
child: Text(
|
|
|
|
|
|
'${TranslationLoader.lanKeys!.forgetPassword!.tr}?',
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
color: AppColors.mainColor, fontSize: 18.sp)),
|
2023-07-18 18:10:57 +08:00
|
|
|
|
),
|
|
|
|
|
|
),
|
2023-07-27 15:26:30 +08:00
|
|
|
|
onTap: () {
|
2024-04-16 17:44:38 +08:00
|
|
|
|
Get.toNamed(Routers.starLockForgetPasswordPage);
|
2023-07-18 18:10:57 +08:00
|
|
|
|
},
|
|
|
|
|
|
)
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
2023-07-27 15:26:30 +08:00
|
|
|
|
));
|
2023-07-18 18:10:57 +08:00
|
|
|
|
}
|
2024-04-30 10:55:48 +08:00
|
|
|
|
|
|
|
|
|
|
Widget loginView() {
|
|
|
|
|
|
Widget view = Column(
|
|
|
|
|
|
children: [
|
|
|
|
|
|
LoginInput(
|
|
|
|
|
|
controller: state.oldPwdController,
|
|
|
|
|
|
onchangeAction: (textStr) {
|
|
|
|
|
|
logic.changeInput(state.oldPwdController);
|
|
|
|
|
|
},
|
|
|
|
|
|
isPwd: true,
|
|
|
|
|
|
leftWidget: Text(
|
|
|
|
|
|
"${TranslationLoader.lanKeys!.originalPassword!.tr} ",
|
|
|
|
|
|
style: TextStyle(fontSize: 22.sp),
|
|
|
|
|
|
),
|
|
|
|
|
|
hintText: "",
|
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
|
LengthLimitingTextInputFormatter(20),
|
|
|
|
|
|
]),
|
|
|
|
|
|
LoginInput(
|
|
|
|
|
|
controller: state.newPwdController,
|
|
|
|
|
|
onchangeAction: (textStr) {
|
|
|
|
|
|
logic.changeInput(state.newPwdController);
|
|
|
|
|
|
},
|
|
|
|
|
|
isPwd: true,
|
|
|
|
|
|
leftWidget: Text(
|
|
|
|
|
|
"${TranslationLoader.lanKeys!.newPassword!.tr} ",
|
|
|
|
|
|
style: TextStyle(fontSize: 22.sp),
|
|
|
|
|
|
),
|
|
|
|
|
|
hintText: "",
|
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
|
LengthLimitingTextInputFormatter(20),
|
|
|
|
|
|
]),
|
|
|
|
|
|
LoginInput(
|
|
|
|
|
|
controller: state.surePwdController,
|
|
|
|
|
|
onchangeAction: (textStr) {
|
|
|
|
|
|
logic.changeInput(state.surePwdController);
|
|
|
|
|
|
},
|
|
|
|
|
|
isPwd: true,
|
|
|
|
|
|
// isHaveLeftWidget: false,
|
|
|
|
|
|
leftWidget: Text(
|
|
|
|
|
|
"${TranslationLoader.lanKeys!.surePassword!.tr} ",
|
|
|
|
|
|
style: TextStyle(fontSize: 22.sp),
|
|
|
|
|
|
),
|
|
|
|
|
|
hintText: "",
|
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
|
LengthLimitingTextInputFormatter(20),
|
|
|
|
|
|
]),
|
|
|
|
|
|
Container(
|
|
|
|
|
|
width: 1.sw,
|
|
|
|
|
|
padding: EdgeInsets.only(top: 15.h, bottom: 10.h),
|
|
|
|
|
|
child: Text(TranslationLoader.lanKeys!.registerPasswordTip!.tr,
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
fontSize: 18.w, color: AppColors.darkGrayTextColor))),
|
|
|
|
|
|
],
|
|
|
|
|
|
);
|
|
|
|
|
|
view = F.sw(
|
2024-05-28 10:40:17 +08:00
|
|
|
|
skyCall: () => view,
|
2024-04-30 10:55:48 +08:00
|
|
|
|
xhjCall: () => Container(
|
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
|
top: 20.h,
|
|
|
|
|
|
),
|
|
|
|
|
|
padding: EdgeInsets.all(16.r),
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20.r))),
|
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
|
borderRadius: BorderRadius.circular(20.r),
|
|
|
|
|
|
child: view,
|
|
|
|
|
|
),
|
|
|
|
|
|
));
|
|
|
|
|
|
return view;
|
|
|
|
|
|
}
|
2023-07-18 18:10:57 +08:00
|
|
|
|
}
|