Skip to content

Commit 94f40f9

Browse files
committed
feat(authentication): add close button to account linking page
- Replace pushNamed with goNamed for navigation - Add IconButton to AppBar for closing account linking - Set Routes.feed as the target route for the close button
1 parent afd7907 commit 94f40f9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/authentication/view/account_linking_page.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@ class AccountLinkingPage extends StatelessWidget {
2121
final colorScheme = Theme.of(context).colorScheme;
2222

2323
return Scaffold(
24-
appBar: AppBar(title: Text(l10n.accountLinkingHeadline)),
24+
appBar: AppBar(
25+
title: Text(l10n.accountLinkingHeadline),
26+
leading: IconButton(
27+
icon: const Icon(Icons.close),
28+
tooltip: MaterialLocalizations.of(context).closeButtonTooltip,
29+
30+
// onPressed context.goNamed() produce the following exception
31+
// "unknown route name: /feed"
32+
onPressed: () => context.go(Routes.feed),
33+
34+
color: colorScheme.onSurface,
35+
),
36+
),
2537
body: BlocConsumer<AuthenticationBloc, AuthenticationState>(
2638
listener: (context, state) {
2739
if (state.status == AuthenticationStatus.failure) {
@@ -75,7 +87,7 @@ class AccountLinkingPage extends StatelessWidget {
7587
onPressed: isLoading
7688
? null
7789
: () {
78-
context.pushNamed(
90+
context.goNamed(
7991
Routes.accountLinkingRequestCodeName,
8092
);
8193
},

0 commit comments

Comments
 (0)