load method
Implementation
@override
Future<bool> load() {
if (state == AdState.loading) return Future.value(false);
state = AdState.loading;
final completer = Completer<bool>();
InterstitialAd.load(
adUnitId: adUnitId,
request: const AdRequest(),
adLoadCallback: InterstitialAdLoadCallback(
onAdLoaded: (ad) {
_ad = ad;
state = AdState.loaded;
_setupCallbacks();
completer.complete(true);
},
onAdFailedToLoad: (error) {
state = AdState.failed;
dPrint('❌ Interstitial load failed: ${error.message}');
completer.complete(false);
},
),
);
return completer.future;
}