-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forgot password UI 🖌️ #124
base: main
Are you sure you want to change the base?
The head ref may contain hidden characters: "ForgotPasswordUI-\u{1F58C}\uFE0F"
Conversation
…o ForgotPasswordAPI-🚀
Currently: Defragmentation of code. |
@werainkhatri Currently the states do not wait for each other they just redirect from one another. Giving no time for Entering email or top and showing error afterward! Can you describe what is the problem here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes. More required. Test the code, fix other bugs and I'll review later.
- Code improvement
replace lines 44-119 with the code below
body: Stack( children: [ ScreenBackground(elementId: 0), BlocConsumer( listener: (context, state) { if (state is ForgotPasswordError) { Scaffold.of(context).showSnackBar( SnackBar(content: Text(state.message)), ); } }, builder: (context, state) { if (state is ForgotLoading) return _buildLoading(context); else if (state is ForgotPasswordError) return _stepScreen(context, state.state); else if (state is ForgotResetSuccess) return _passwordResetSuccess(); else return _stepScreen(context, state); }, ), ], ), ); }
Widget _stepScreen(BuildContext context, ForgotPasswordState state) { if (state is ForgotEmailInitial) return AskEmailScreen( emailController: emailController, onSubmit: () => _sendOTP(context, state), ); else if (state is ForgotOTPInitial) return EnterOTPScreen( numSelected: _onNumSelected, otp: otpEntered, toVerify: () => _verifyOtp(context, state), ); else if (state is ForgotResetInitial) return ResetPassword( onConfirm: () => _changePassword(context, state), confirmPasswordController: confirmPasswordController, passwordController: passwordController, ); else return AskEmailScreen( emailController: emailController, onSubmit: () => _sendOTP(context, state), ); }
- Add scroll feature (when user opens keyboard, screen scrolls, as in loginscreen)
- Update the delayed duration in FakeRepository to 1s.
…o ForgotPasswordUI-🖌️
Fixes #18
Description
#18
Type of Change: (Delete irrelevant options)
Code/Quality Assurance Only (Delete irrelevant options)
How Has This Been Tested?
Describe the tests you ran to verify your changes. Provide instructions or GIFs so we can reproduce. List any relevant details for your test.
Checklist:
Code/Quality Assurance
Mention the dependencies/packages/plugins that have been added (if any)