Skip to content

Commit fdb7ebb

Browse files
committed
refactor(navigation): launch AccountPage from app bar
Updated the onTap action for the user avatar in the FeedSliverAppBar. It no longer shows a modal bottom sheet. Instead, it now navigates to the new top-level /account route using context.pushNamed(Routes.accountName).
1 parent 2dc972c commit fdb7ebb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/headlines-feed/widgets/feed_sliver_app_bar.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import 'package:core/core.dart';
22
import 'package:data_repository/data_repository.dart';
33
import 'package:flutter/material.dart';
44
import 'package:flutter_bloc/flutter_bloc.dart';
5-
import 'package:flutter_news_app_mobile_client_full_source_code/account/widgets/account_sheet.dart';
65
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
76
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-search/bloc/headlines_search_bloc.dart';
87
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-search/view/headline_search_delegate.dart';
98
import 'package:flutter_news_app_mobile_client_full_source_code/l10n/l10n.dart';
9+
import 'package:flutter_news_app_mobile_client_full_source_code/router/routes.dart';
1010
import 'package:flutter_news_app_mobile_client_full_source_code/shared/widgets/user_avatar.dart';
11+
import 'package:go_router/go_router.dart';
1112
import 'package:ui_kit/ui_kit.dart';
1213

1314
/// {@template feed_sliver_app_bar}
@@ -74,10 +75,7 @@ class FeedSliverAppBar extends StatelessWidget {
7475
// The user avatar is also tappable to open the account sheet.
7576
GestureDetector(
7677
onTap: () {
77-
showModalBottomSheet<void>(
78-
context: context,
79-
builder: (_) => const AccountSheet(),
80-
);
78+
context.pushNamed(Routes.accountName);
8179
},
8280
child: BlocSelector<AppBloc, AppState, User?>(
8381
selector: (state) => state.user,

0 commit comments

Comments
 (0)