fixed auth pages sizes and push notification navigate bug

This commit is contained in:
amirrezaghabeli
2025-09-24 13:11:48 +03:30
parent a8e65f3cb5
commit 8458da4f15
10 changed files with 372 additions and 360 deletions
@@ -52,135 +52,138 @@ class _MobileForgotPasswordCreatePageState
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.backgroundColor,
body: Center(
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
child: Consumer<AuthViewModel>(
builder: (context, viewModel, _) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
child: SvgPicture.asset(
AssetsManager.logoBig,
width: double.infinity,
height: 50.0.h(),
resizeToAvoidBottomInset: false,
body: SafeArea(
child: Center(
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
child: Consumer<AuthViewModel>(
builder: (context, viewModel, _) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
child: SvgPicture.asset(
AssetsManager.logoBig,
width: double.infinity,
height: 50.0.h(),
),
),
),
SizedBox(height: 72.0.h()),
Text(
ForgotPasswordCreateStrings.forgotPasswordTitle,
style: TextStyle(
fontSize: 28.0.sp(),
fontWeight: FontWeight.bold,
color: AppColors.grey80,
SizedBox(height: 72.0.h()),
Text(
ForgotPasswordCreateStrings.forgotPasswordTitle,
style: TextStyle(
fontSize: 28.0.sp(),
fontWeight: FontWeight.bold,
color: AppColors.grey80,
),
),
),
SizedBox(height: 16.0.h()),
Text(
ForgotPasswordCreateStrings.forgotPasswordSubtitle,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
),
SizedBox(height: 40.0.h()),
LoginTextField(
controller: viewModel.newPasswordController,
focusNode: viewModel.newPasswordFocus,
label: ForgotPasswordCreateStrings.createNewPassword,
iconPath: AssetsManager.passwordIcon,
isPassword: true,
obscureText: viewModel.obscureForgotPassword,
onToggleVisibility:
viewModel.toggleForgotPasswordVisibility,
),
SizedBox(height: 16.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLast5Character,
SizedBox(height: 16.0.h()),
Text(
ForgotPasswordCreateStrings.forgotPasswordSubtitle,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
),
),
SizedBox(height: 6.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLeast1uppercase,
style: TextStyle(
fontSize: 14.0.sp(),
color: AppColors.grey60,
SizedBox(height: 40.0.h()),
LoginTextField(
controller: viewModel.newPasswordController,
focusNode: viewModel.newPasswordFocus,
label: ForgotPasswordCreateStrings.createNewPassword,
iconPath: AssetsManager.passwordIcon,
isPassword: true,
obscureText: viewModel.obscureForgotPassword,
onToggleVisibility:
viewModel.toggleForgotPasswordVisibility,
),
SizedBox(height: 16.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLast5Character,
style: TextStyle(
fontSize: 14.0.sp(),
color: AppColors.grey60,
),
),
),
),
SizedBox(height: 6.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLeast1lowercase,
style: TextStyle(
fontSize: 14.0.sp(),
color: AppColors.grey60,
SizedBox(height: 6.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLeast1uppercase,
style: TextStyle(
fontSize: 14.0.sp(),
color: AppColors.grey60,
),
),
),
),
SizedBox(height: 6.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLeastSpecial,
style: TextStyle(
fontSize: 14.0.sp(),
color: AppColors.grey60,
SizedBox(height: 6.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLeast1lowercase,
style: TextStyle(
fontSize: 14.0.sp(),
color: AppColors.grey60,
),
),
),
),
SizedBox(height: 80.0.h()),
viewModel.isResetPasswordLoading
? BaseButton(
isEnabled: viewModel.isNewPasswordValid,
text: ForgotPasswordCreateStrings.resetLink,
onPressed: null,
isLoading: true,
)
: BaseButton(
isEnabled: viewModel.isNewPasswordValid,
text: ForgotPasswordCreateStrings.resetLink,
onPressed:
viewModel.isNewPasswordValid
? () async {
viewModel.resetPassword();
}
: null,
SizedBox(height: 6.0.h()),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 16.0.w()),
child: Text(
ForgotPasswordCreateStrings.atLeastSpecial,
style: TextStyle(
fontSize: 14.0.sp(),
color: AppColors.grey60,
),
),
),
SizedBox(height: 80.0.h()),
viewModel.isResetPasswordLoading
? BaseButton(
isEnabled: viewModel.isNewPasswordValid,
text: ForgotPasswordCreateStrings.resetLink,
onPressed: null,
isLoading: true,
)
: BaseButton(
isEnabled: viewModel.isNewPasswordValid,
text: ForgotPasswordCreateStrings.resetLink,
onPressed:
viewModel.isNewPasswordValid
? () async {
viewModel.resetPassword();
}
: null,
),
TextButton(
onPressed: () {
context.pop();
},
child: Text(
ForgotPasswordCreateStrings.backToSignInButton,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.mainBlue,
TextButton(
onPressed: () {
context.pop();
},
child: Text(
ForgotPasswordCreateStrings.backToSignInButton,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.mainBlue,
),
),
),
),
],
);
},
],
);
},
),
),
),
),