InterstitialAdService class

Service dedicated to managing the lifecycle of Interstitial Ads.

Features:

  • AdMob Policy Guard: 4-hour max-age cache invalidation.
  • AdMob Policy Guard: Anti-collision full-screen presentation lock.
  • AdMob Policy Guard: Minimum interval throttling (30s) to prevent user fatigue.
  • Exponential backoff retry logic with automatic cancellation on disposal.
  • Automatic Impression-Level Ad Revenue (ILRD) tracking.

Constructors

InterstitialAdService()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isAdAvailable → bool
Whether an interstitial ad is loaded and ready to be shown.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Disposes active ad and cancels state.
loadAd({String? adUnitId, AdRequest? request, VoidCallback? onLoaded, dynamic onFailedToLoad(LoadAdError error)?}) → void
Loads an Interstitial Ad.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
showAd({VoidCallback? onAdShowedFullScreenContent, VoidCallback? onAdDismissedFullScreenContent, dynamic onAdFailedToShowFullScreenContent(AdError error)?, VoidCallback? onAdClicked, VoidCallback? onAdImpression, OnPaidEventCallback? onPaidEvent}) → void
Displays the loaded Interstitial ad with interval throttling and collision guards.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

maxAdAge → const Duration
Max age before cached ad is considered stale according to AdMob policy (4 hours).
maxRetryAttempts → const int
Max retry attempts on load failure.
minInterstitialInterval → const Duration
Minimum interval between showing interstitial ads to prevent ad fatigue (30 seconds).