show method
Future
show({
- bool? immersiveMode,
- FullScreenContentCallback<
InterstitialAd> ? fullScreenContentCallback,
Implementation
Future show({
bool? immersiveMode,
FullScreenContentCallback<InterstitialAd>? fullScreenContentCallback,
}) async {
ad.fullScreenContentCallback = FullScreenContentCallback(
onAdShowedFullScreenContent: (ad) {
fullScreenContentCallback?.onAdShowedFullScreenContent?.call(ad);
},
onAdImpression: (ad) {
fullScreenContentCallback?.onAdImpression?.call(ad);
},
onAdFailedToShowFullScreenContent: (ad, error) {
fullScreenContentCallback?.onAdFailedToShowFullScreenContent
?.call(ad, error);
},
onAdWillDismissFullScreenContent: (ad) {
fullScreenContentCallback?.onAdWillDismissFullScreenContent?.call(ad);
},
onAdDismissedFullScreenContent: (ad) {
fullScreenContentCallback?.onAdDismissedFullScreenContent?.call(ad);
},
onAdClicked: (ad) {
fullScreenContentCallback?.onAdClicked?.call(ad);
},
);
if (immersiveMode != null) {
ad.setImmersiveMode(immersiveMode);
}
try {
await ad.show();
} catch (e) {
rethrow;
} finally {
dispose();
}
}