Skip to content

Commit c1f74e9

Browse files
committed
feat(entity_details): integrate AdService and enhance theming
- Inject AdService into FeedDecoratorService for targeted advertising - Pass current theme to EntityDetailsBloc for context-aware theming
1 parent bccd8f3 commit c1f74e9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/entity_details/view/entity_details_page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:data_repository/data_repository.dart';
55
import 'package:flutter/material.dart';
66
import 'package:flutter_bloc/flutter_bloc.dart';
77
import 'package:flutter_news_app_mobile_client_full_source_code/account/bloc/account_bloc.dart';
8+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/ad_service.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/entity_details/bloc/entity_details_bloc.dart';
1011
import 'package:flutter_news_app_mobile_client_full_source_code/l10n/app_localizations.dart';
@@ -48,9 +49,11 @@ class EntityDetailsPage extends StatelessWidget {
4849
create: (context) {
4950
final topicsRepository = context.read<DataRepository<Topic>>();
5051
final sourcesRepository = context.read<DataRepository<Source>>();
52+
final adService = context.read<AdService>();
5153
final feedDecoratorService = FeedDecoratorService(
5254
topicsRepository: topicsRepository,
5355
sourcesRepository: sourcesRepository,
56+
adService: adService,
5457
);
5558
final entityDetailsBloc =
5659
EntityDetailsBloc(
@@ -65,6 +68,7 @@ class EntityDetailsPage extends StatelessWidget {
6568
entityId: args.entityId,
6669
contentType: args.contentType,
6770
entity: args.entity,
71+
theme: Theme.of(context), // Pass the current theme
6872
),
6973
);
7074
return entityDetailsBloc;

0 commit comments

Comments
 (0)