Skip to content

Commit 721f8b8

Browse files
committed
feat(ads): add interstitial ad trigger on topic item tap
- Import InterstitialAdManager and Bloc dependencies - Add interstitial ad trigger logic in TopicItemWidget's onTap event
1 parent 946d840 commit 721f8b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/headlines-search/widgets/topic_item_widget.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'package:core/core.dart';
22
import 'package:flutter/material.dart';
3+
import 'package:flutter_bloc/flutter_bloc.dart';
4+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/interstitial_ad_manager.dart';
35
import 'package:flutter_news_app_mobile_client_full_source_code/router/routes.dart';
46
import 'package:go_router/go_router.dart';
57

@@ -21,6 +23,9 @@ class TopicItemWidget extends StatelessWidget {
2123
)
2224
: null,
2325
onTap: () {
26+
context
27+
.read<InterstitialAdManager>()
28+
.onPotentialAdTrigger(context: context);
2429
context.pushNamed(
2530
Routes.entityDetailsName,
2631
pathParameters: {'type': ContentType.topic.name, 'id': topic.id},

0 commit comments

Comments
 (0)