Skip to content

Commit e4f81e0

Browse files
committed
refactor(entity_details): update ad theme style handling
- Replace 'theme' parameter with 'adThemeStyle' in createFeedContext - Update default ad theme style handling for pagination - Improve type safety and consistency in ad theming
1 parent a6fe42b commit e4f81e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/entity_details/bloc/entity_details_bloc.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class EntityDetailsBloc extends Bloc<EntityDetailsEvent, EntityDetailsState> {
115115
user: currentUser,
116116
adConfig: remoteConfig.adConfig,
117117
imageStyle: _appBloc.state.settings.feedPreferences.headlineImageStyle,
118-
theme: event.theme,
118+
adThemeStyle: event.adThemeStyle,
119119
);
120120

121121
// 3. Determine isFollowing status
@@ -217,9 +217,9 @@ class EntityDetailsBloc extends Bloc<EntityDetailsEvent, EntityDetailsState> {
217217
user: currentUser,
218218
adConfig: remoteConfig.adConfig,
219219
imageStyle: _appBloc.state.settings.feedPreferences.headlineImageStyle,
220-
theme: _appBloc.state.themeMode == ThemeMode.dark
221-
? ThemeData.dark()
222-
: ThemeData.light(), // Use a default theme for pagination if not passed
220+
adThemeStyle: AdThemeStyle.fromTheme(
221+
ThemeData(brightness: _appBloc.state.themeMode == ThemeMode.dark ? Brightness.dark : Brightness.light),
222+
), // Use a default AdThemeStyle for pagination if not passed
223223
// Calculate the count of actual content items (headlines) already in the
224224
// feed. This is crucial for the FeedDecoratorService to correctly apply
225225
// ad placement rules across paginated loads.

0 commit comments

Comments
 (0)