AdManagerBannerAdListener constructor
AdManagerBannerAdListener({
- AdEventCallback? onAdLoaded,
- dynamic onAdFailedToLoad(
- Ad ad,
- LoadAdError error
- AdEventCallback? onAdOpened,
- AdEventCallback? onAdWillDismissScreen,
- AdEventCallback? onAdClosed,
- AdEventCallback? onAdImpression,
- OnPaidEventCallback? onPaidEvent,
- void onAppEvent()?,
- AdEventCallback? onAdClicked,
Constructs an AdManagerBannerAdListener with the provided event callbacks.
Typically you will override onAdLoaded
and onAdFailedToLoad
:
AdManagerBannerAdListener(
onAdLoaded: (ad) {
// Ad successfully loaded - display an AdWidget with the banner ad.
},
onAdFailedToLoad: (ad, error) {
// Ad failed to load - log the error and dispose the ad.
},
...
)
Implementation
AdManagerBannerAdListener({
AdEventCallback? onAdLoaded,
Function(Ad ad, LoadAdError error)? onAdFailedToLoad,
AdEventCallback? onAdOpened,
AdEventCallback? onAdWillDismissScreen,
AdEventCallback? onAdClosed,
AdEventCallback? onAdImpression,
OnPaidEventCallback? onPaidEvent,
this.onAppEvent,
AdEventCallback? onAdClicked,
}) : super(
onAdLoaded: onAdLoaded,
onAdFailedToLoad: onAdFailedToLoad,
onAdOpened: onAdOpened,
onAdWillDismissScreen: onAdWillDismissScreen,
onAdClosed: onAdClosed,
onAdImpression: onAdImpression,
onPaidEvent: onPaidEvent,
onAdClicked: onAdClicked,
);