BannerAdListener constructor

const BannerAdListener({
  1. AdEventCallback? onAdLoaded,
  2. AdLoadErrorCallback? onAdFailedToLoad,
  3. AdEventCallback? onAdOpened,
  4. AdEventCallback? onAdClosed,
  5. AdEventCallback? onAdWillDismissScreen,
  6. AdEventCallback? onAdImpression,
  7. OnPaidEventCallback? onPaidEvent,
  8. 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,
      );