Skip to content

Commit c368da7

Browse files
committed
fix(headlines): fixed notification ruting issue
1 parent c0df42a commit c368da7

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

lib/headlines-feed/view/headlines_feed_page.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@ class _HeadlinesFeedViewState extends State<_HeadlinesFeedView> {
7575

7676
return Scaffold(
7777
appBar: AppBar(
78-
centerTitle: true, // Center the title
79-
leading: IconButton( // Add leading icon button
80-
icon: const Icon(Icons.notifications_outlined),
81-
tooltip: l10n.notificationsTooltip, // Add tooltip for accessibility
82-
onPressed: () {
83-
context.goNamed(Routes.notificationsName);
84-
},
85-
),
8678
title: Text(
8779
'HT', // TODO(fulleni): Localize this title
8880
style: textTheme.titleLarge?.copyWith(fontWeight: FontWeight.bold),
8981
),
9082
actions: [
91-
// Removed Search IconButton
83+
IconButton(
84+
icon: const Icon(Icons.notifications_outlined),
85+
tooltip: l10n.notificationsTooltip, // Add tooltip for accessibility
86+
onPressed: () {
87+
context.goNamed(
88+
Routes.notificationsName,
89+
); // Ensure correct route name
90+
},
91+
),
9292
BlocBuilder<HeadlinesFeedBloc, HeadlinesFeedState>(
9393
builder: (context, state) {
9494
var isFilterApplied = false;

lib/router/router.dart

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ GoRouter createRouter({required ValueNotifier<AppStatus> authStatusNotifier}) {
7676
// Let the initial navigation attempt proceed. The refreshListenable
7777
// will trigger a redirect check again once the status is known.
7878
if (appStatus == AppStatus.initial) {
79-
print(' Redirect Decision: AppStatus is INITIAL. Allowing navigation.');
79+
print(
80+
' Redirect Decision: AppStatus is INITIAL. Allowing navigation.',
81+
);
8082
return null; // Do not redirect during initial phase
8183
}
8284

@@ -261,6 +263,17 @@ GoRouter createRouter({required ValueNotifier<AppStatus> authStatusNotifier}) {
261263
return HeadlineDetailsPage(headlineId: id);
262264
},
263265
),
266+
// Sub-route for notifications (placeholder) - MOVED HERE
267+
GoRoute(
268+
path: Routes.notifications, // Relative path 'notifications'
269+
name: Routes.notificationsName,
270+
builder: (context, state) {
271+
// TODO(fulleni): Replace with actual NotificationsPage
272+
return const Placeholder(
273+
child: Center(child: Text('NOTIFICATIONS PAGE')),
274+
);
275+
},
276+
),
264277
],
265278
),
266279
],
@@ -294,17 +307,6 @@ GoRouter createRouter({required ValueNotifier<AppStatus> authStatusNotifier}) {
294307
);
295308
},
296309
),
297-
// Sub-route for notifications (placeholder)
298-
GoRoute(
299-
path: Routes.notifications, // Relative path 'notifications'
300-
name: Routes.notificationsName,
301-
builder: (context, state) {
302-
// TODO(fulleni): Replace with actual NotificationsPage
303-
return const Placeholder(
304-
child: Center(child: Text('NOTIFICATIONS PAGE')),
305-
);
306-
},
307-
),
308310
],
309311
),
310312
],

0 commit comments

Comments
 (0)