Skip to content

Commit 84b23c6

Browse files
authored
Merge pull request #144 from flutter-news-app-full-source-code/fix/use-pushNamed-for-auth-flow-to-preserve-navigation-stack
Fix/use push named for auth flow to preserve navigation stack
2 parents 81485d3 + 4247e36 commit 84b23c6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/authentication/view/account_linking_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class AccountLinkingPage extends StatelessWidget {
7575
onPressed: isLoading
7676
? null
7777
: () {
78-
context.goNamed(
78+
context.pushNamed(
7979
Routes.accountLinkingRequestCodeName,
8080
);
8181
},

lib/authentication/view/authentication_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class AuthenticationPage extends StatelessWidget {
8585
onPressed: isLoading
8686
? null
8787
: () {
88-
context.goNamed(Routes.requestCodeName);
88+
context.pushNamed(Routes.requestCodeName);
8989
},
9090
label: Text(l10n.authenticationEmailSignInButton),
9191
style: ElevatedButton.styleFrom(

lib/authentication/view/request_code_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ class _RequestCodeView extends StatelessWidget {
7272
context,
7373
).routerDelegate.currentConfiguration.last.route.name;
7474
if (currentRouteName == Routes.accountLinkingRequestCodeName) {
75-
context.goNamed(
75+
context.pushNamed(
7676
Routes.accountLinkingVerifyCodeName,
7777
pathParameters: {'email': state.email!},
7878
);
7979
} else {
80-
context.goNamed(
80+
context.pushNamed(
8181
Routes.verifyCodeName,
8282
pathParameters: {'email': state.email!},
8383
);

0 commit comments

Comments
 (0)