Skip to content

Commit c6f7659

Browse files
committed
feat(ads): pass ad theme style to headlines feed on initial load
- Import AdThemeStyle model - Modify router to pass AdThemeStyle to HeadlinesFeedFetchRequested event - Use Theme.of(context) to determine ad theme style
1 parent 86743cc commit c6f7659

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/router/router.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:flutter_news_app_mobile_client_full_source_code/account/view/man
1212
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/topics/followed_topics_list_page.dart';
1313
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/saved_headlines_page.dart';
1414
import 'package:flutter_news_app_mobile_client_full_source_code/ads/ad_service.dart';
15+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_theme_style.dart';
1516
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
1617
import 'package:flutter_news_app_mobile_client_full_source_code/app/config/config.dart'
1718
as local_config;
@@ -371,7 +372,11 @@ GoRouter createRouter({
371372
.read<DataRepository<UserContentPreferences>>(),
372373
feedDecoratorService: feedDecoratorService,
373374
appBloc: context.read<AppBloc>(),
374-
)..add(const HeadlinesFeedFetchRequested());
375+
)..add(
376+
HeadlinesFeedFetchRequested(
377+
adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context)),
378+
),
379+
);
375380
},
376381
),
377382
BlocProvider(

0 commit comments

Comments
 (0)