File tree Expand file tree Collapse file tree
packages/flutter_user/lib/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,14 +173,13 @@ class _FlutterUserNavigatorUserstoryState
173173 var requestPasswordReponse =
174174 await userService! .requestChangePassword (email: email);
175175
176+ if (! mounted) return ;
177+ Navigator .of (context).pop ();
178+
176179 if (requestPasswordReponse.requestSuccesfull) {
177- if (context.mounted) {
178- await pushReplacement (_forgotPasswordSuccessScreen ());
179- }
180+ await pushReplacement (_forgotPasswordSuccessScreen ());
180181 } else {
181- if (context.mounted) {
182- await push (_forgotPasswordUnsuccessfullScreen ());
183- }
182+ await push (_forgotPasswordUnsuccessfullScreen ());
184183 }
185184 }
186185
@@ -272,7 +271,7 @@ class _FlutterUserNavigatorUserstoryState
272271
273272 Future <void > pushReplacement (Widget screen) async {
274273 if (! context.mounted) return ;
275- await Navigator .of (context).push (
274+ await Navigator .of (context).pushReplacement (
276275 MaterialPageRoute (
277276 builder: (context) => screen,
278277 ),
You can’t perform that action at this time.
0 commit comments