BannerAdListener constructor
const
BannerAdListener({
- AdEventCallback? onAdLoaded,
- AdLoadErrorCallback? onAdFailedToLoad,
- AdEventCallback? onAdOpened,
- AdEventCallback? onAdClosed,
- AdEventCallback? onAdWillDismissScreen,
- AdEventCallback? onAdImpression,
- OnPaidEventCallback? onPaidEvent,
- AdEventCallback? onAdClicked,
Constructs a BannerAdListener that notifies for the provided event callbacks.
Typically you will override onAdLoaded
and onAdFailedToLoad
:
BannerAdListener(
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
const BannerAdListener({
AdEventCallback? onAdLoaded,
AdLoadErrorCallback? onAdFailedToLoad,
AdEventCallback? onAdOpened,
AdEventCallback? onAdClosed,
AdEventCallback? onAdWillDismissScreen,
AdEventCallback? onAdImpression,
OnPaidEventCallback? onPaidEvent,
AdEventCallback? onAdClicked,
}) : super(
onAdLoaded: onAdLoaded,
onAdFailedToLoad: onAdFailedToLoad,
onAdOpened: onAdOpened,
onAdClosed: onAdClosed,
onAdWillDismissScreen: onAdWillDismissScreen,
onAdImpression: onAdImpression,
onPaidEvent: onPaidEvent,
onAdClicked: onAdClicked,
);