Skip to content

Commit f3ae38e

Browse files
committed
feat(headlines-search): pass image style to AdLoaderWidget
- Retrieve headline image style from AppBloc state - Pass the image style to AdLoaderWidget for consistent styling
1 parent 8594d4f commit f3ae38e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/headlines-search/view/headlines_search_page.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,22 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
345345
} else if (feedItem is Source) {
346346
return SourceItemWidget(source: feedItem);
347347
} else if (feedItem is AdPlaceholder) {
348+
// Retrieve the user's preferred headline image style from the AppBloc.
349+
// This is the single source of truth for this setting.
350+
final imageStyle = context
351+
.watch<AppBloc>()
352+
.state
353+
.settings
354+
.feedPreferences
355+
.headlineImageStyle;
356+
348357
return AdLoaderWidget(
349358
adPlaceholder: feedItem,
350359
adService: context.read<AdService>(),
351360
adThemeStyle: AdThemeStyle.fromTheme(
352361
Theme.of(context),
353362
),
363+
imageStyle: imageStyle,
354364
);
355365
}
356366
return const SizedBox.shrink();

0 commit comments

Comments
 (0)