File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
packages/flutter_user/lib/src Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -173,14 +173,14 @@ class _FlutterUserNavigatorUserstoryState
173173 var requestPasswordReponse =
174174 await userService! .requestChangePassword (email: email);
175175
176+ if (! context.mounted) return ;
177+ // ignore: use_build_context_synchronously
178+ Navigator .of (context).pop ();
179+
176180 if (requestPasswordReponse.requestSuccesfull) {
177- if (context.mounted) {
178- await pushReplacement (_forgotPasswordSuccessScreen ());
179- }
181+ await pushReplacement (_forgotPasswordSuccessScreen ());
180182 } else {
181- if (context.mounted) {
182- await push (_forgotPasswordUnsuccessfullScreen ());
183- }
183+ await push (_forgotPasswordUnsuccessfullScreen ());
184184 }
185185 }
186186
@@ -272,7 +272,7 @@ class _FlutterUserNavigatorUserstoryState
272272
273273 Future <void > pushReplacement (Widget screen) async {
274274 if (! context.mounted) return ;
275- await Navigator .of (context).push (
275+ await Navigator .of (context).pushReplacement (
276276 MaterialPageRoute (
277277 builder: (context) => screen,
278278 ),
You can’t perform that action at this time.
0 commit comments