AdManagerBannerAdListener constructor

AdManagerBannerAdListener({
  1. AdEventCallback? onAdLoaded,
  2. dynamic onAdFailedToLoad(
    1. Ad ad,
    2. LoadAdError error
    )?,
  3. AdEventCallback? onAdOpened,
  4. AdEventCallback? onAdWillDismissScreen,
  5. AdEventCallback? onAdClosed,
  6. AdEventCallback? onAdImpression,
  7. OnPaidEventCallback? onPaidEvent,
  8. void onAppEvent(
    1. Ad ad,
    2. String name,
    3. String data
    )?,
  9. 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,
      );