Skip to content

Commit 91cac5a

Browse files
committed
feat(headlines-feed): pass theme to headlines feed bloc
- Add theme parameter to headline feed requests - Update HeadlinesFeedBloc to include theme in emitted states - Modify relevant events to carry theme information
1 parent da8242d commit 91cac5a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/headlines-feed/bloc/headlines_feed_bloc.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:bloc_concurrency/bloc_concurrency.dart';
55
import 'package:core/core.dart';
66
import 'package:data_repository/data_repository.dart';
77
import 'package:equatable/equatable.dart';
8+
import 'package:flutter/material.dart';
89
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
910
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/models/headline_filter.dart';
1011
import 'package:flutter_news_app_mobile_client_full_source_code/shared/services/feed_decorator_service.dart';
@@ -115,6 +116,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
115116
adConfig: remoteConfig.adConfig,
116117
imageStyle:
117118
_appBloc.state.settings.feedPreferences.headlineImageStyle,
119+
theme: event.theme,
118120
// Calculate the count of actual content items (headlines) already in the
119121
// feed. This is crucial for the FeedDecoratorService to correctly apply
120122
// ad placement rules across paginated loads.
@@ -170,6 +172,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
170172
userPreferences?.followedSources.map((s) => s.id).toList() ?? [],
171173
imageStyle:
172174
_appBloc.state.settings.feedPreferences.headlineImageStyle,
175+
theme: event.theme,
173176
);
174177

175178
emit(
@@ -251,6 +254,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
251254
userPreferences?.followedSources.map((s) => s.id).toList() ?? [],
252255
imageStyle:
253256
_appBloc.state.settings.feedPreferences.headlineImageStyle,
257+
theme: event.theme,
254258
);
255259

256260
emit(
@@ -329,6 +333,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
329333
userPreferences?.followedSources.map((s) => s.id).toList() ?? [],
330334
imageStyle:
331335
_appBloc.state.settings.feedPreferences.headlineImageStyle,
336+
theme: event.theme,
332337
);
333338

334339
emit(

0 commit comments

Comments
 (0)