Skip to content

Commit e7f8e43

Browse files
committed
refactor(headlines-feed): improve empty filtered state UI
- Replace FailureStateWidget with a custom empty state design - Add InitialStateWidget to show an empty state illustration - Include a button to clear filters and refresh the feed - Update localization keys for the new UI elements
1 parent b28774a commit e7f8e43

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

lib/headlines-feed/view/headlines_feed_page.dart

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,24 @@ class _HeadlinesFeedPageState extends State<HeadlinesFeedPage> {
175175

176176
if (state.status == HeadlinesFeedStatus.success &&
177177
state.feedItems.isEmpty) {
178-
return FailureStateWidget(
179-
exception: const UnknownException(
180-
'No headlines found matching your criteria.',
181-
),
182-
onRetry: () => context.read<HeadlinesFeedBloc>().add(
183-
HeadlinesFeedFiltersCleared(),
178+
return Center(
179+
child: Column(
180+
mainAxisAlignment: MainAxisAlignment.center,
181+
children: [
182+
InitialStateWidget(
183+
icon: Icons.search_off,
184+
headline: l10n.headlinesFeedEmptyFilteredHeadline,
185+
subheadline: l10n.headlinesFeedEmptyFilteredSubheadline,
186+
),
187+
const SizedBox(height: AppSpacing.lg),
188+
ElevatedButton(
189+
onPressed: () => context.read<HeadlinesFeedBloc>().add(
190+
HeadlinesFeedFiltersCleared(),
191+
),
192+
child: Text(l10n.headlinesFeedClearFiltersButton),
193+
),
194+
],
184195
),
185-
retryButtonText: l10n.headlinesFeedClearFiltersButton,
186196
);
187197
}
188198

0 commit comments

Comments
 (0)