Skip to content

Commit fd22b17

Browse files
committed
feat(ads): implement local interstitial ad display
- Replace TODO comment with actual implementation using LocalInterstitialAdDialog - Add necessary import for LocalInterstitialAdDialog widget - Update log message to reflect actual ad display
1 parent 9e8510e commit fd22b17

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/ads/ad_navigator_observer.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:core/core.dart';
44
import 'package:flutter/material.dart';
55
import 'package:flutter_news_app_mobile_client_full_source_code/ads/ad_service.dart';
66
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_theme_style.dart';
7+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/widgets/widgets.dart';
78
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
89
import 'package:google_mobile_ads/google_mobile_ads.dart' as admob;
910
import 'package:logging/logging.dart';
@@ -168,8 +169,13 @@ class AdNavigatorObserver extends NavigatorObserver {
168169
await admobInterstitialAd.show();
169170
} else if (interstitialAd.provider == AdPlatformType.local &&
170171
interstitialAd.adObject is LocalInterstitialAd) {
171-
// TODO(fulleni): Implement showing local interstitial ad (e.g., via a dialog).
172-
_logger.info('Showing local interstitial ad (placeholder).');
172+
_logger.info('Showing local interstitial ad.');
173+
await showDialog<void>(
174+
context: navigator!.context,
175+
builder: (context) => LocalInterstitialAdDialog(
176+
localInterstitialAd: interstitialAd.adObject as LocalInterstitialAd,
177+
),
178+
);
173179
}
174180
} else {
175181
_logger.info('No interstitial ad loaded.');

0 commit comments

Comments
 (0)