Skip to content

Commit d5c57a8

Browse files
committed
fix(headlines-feed): pass HeadlinesFilterBloc to child filter page
- Modify navigation to child filter page by passing the current HeadlinesFilterBloc instance as an extra argument - This ensures the child page can access the bloc directly, maintaining state consistency - Update comments to reflect the new implementation
1 parent edac84e commit d5c57a8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/headlines-feed/view/headlines_filter_page.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ class _HeadlinesFilterView extends StatelessWidget {
8282
enabled: enabled,
8383
onTap: enabled
8484
? () {
85-
// Navigate to the child filter page. The child page will read
86-
// the current selections from HeadlinesFilterBloc directly.
87-
context.pushNamed(routeName);
85+
// Navigate to the child filter page, passing the current
86+
// HeadlinesFilterBloc instance as an extra argument.
87+
// This ensures the child page can access the bloc directly.
88+
context.pushNamed(
89+
routeName,
90+
extra: context.read<HeadlinesFilterBloc>(),
91+
);
8892
}
8993
: null,
9094
);

0 commit comments

Comments
 (0)