Skip to content

Commit 585c079

Browse files
committed
refactor(entity_details): update ad injection theming approach
- Replace ThemeData with AdThemeStyle in EntityDetailsLoadRequested event - Update props to include adThemeStyle - Improve code clarity and maintainability for ad theming
1 parent 0e7b7f3 commit 585c079

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/entity_details/bloc/entity_details_bloc.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:data_repository/data_repository.dart';
88
import 'package:equatable/equatable.dart';
99
import 'package:flutter/material.dart';
1010
import 'package:flutter_news_app_mobile_client_full_source_code/account/bloc/account_bloc.dart';
11+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_theme_style.dart';
1112
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
1213
import 'package:flutter_news_app_mobile_client_full_source_code/shared/services/feed_decorator_service.dart';
1314

lib/entity_details/bloc/entity_details_event.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ abstract class EntityDetailsEvent extends Equatable {
1414
/// or an [entityId] and its corresponding [contentType].
1515
class EntityDetailsLoadRequested extends EntityDetailsEvent {
1616
const EntityDetailsLoadRequested({
17-
required this.theme,
17+
required this.adThemeStyle,
1818
this.entityId,
1919
this.contentType,
2020
this.entity,
@@ -32,11 +32,11 @@ class EntityDetailsLoadRequested extends EntityDetailsEvent {
3232
/// The full entity object, if already available.
3333
final FeedItem? entity;
3434

35-
/// The current theme data, required for ad injection.
36-
final ThemeData theme;
35+
/// The current ad theme style, required for ad injection.
36+
final AdThemeStyle adThemeStyle;
3737

3838
@override
39-
List<Object?> get props => [entityId, contentType, entity];
39+
List<Object?> get props => [entityId, contentType, entity, adThemeStyle];
4040
}
4141

4242
/// Event to toggle the "follow" status of the currently loaded entity.

0 commit comments

Comments
 (0)