loadBannerAdTurbo method
Future<void>
loadBannerAdTurbo({
- required String adUnitId,
- required AdSize adSize,
- List<
String> ? keywords, - String? contentUrl,
- List<
String> ? neighboringContentUrls, - bool? nonPersonalizedAds,
- int? httpTimeoutMillis,
- String? mediationExtrasIdentifier,
- Map<
String, String> ? extras, - AdEventCallback? onAdLoaded,
- AdLoadErrorCallback? onAdFailedToLoad,
- AdEventCallback? onAdOpened,
- AdEventCallback? onAdClosed,
- AdEventCallback? onAdWillDismissScreen,
- AdEventCallback? onAdImpression,
- OnPaidEventCallback? onPaidEvent,
- AdEventCallback? onAdClicked,
Implementation
Future<void> loadBannerAdTurbo({
required String adUnitId,
required AdSize adSize,
List<String>? keywords,
String? contentUrl,
List<String>? neighboringContentUrls,
bool? nonPersonalizedAds,
int? httpTimeoutMillis,
String? mediationExtrasIdentifier,
Map<String, String>? extras,
AdEventCallback? onAdLoaded,
AdLoadErrorCallback? onAdFailedToLoad,
AdEventCallback? onAdOpened,
AdEventCallback? onAdClosed,
AdEventCallback? onAdWillDismissScreen,
AdEventCallback? onAdImpression,
OnPaidEventCallback? onPaidEvent,
AdEventCallback? onAdClicked,
}) async {
bannerAd = BannerAd(
adUnitId: adUnitId,
request: AdRequest(
keywords: keywords,
contentUrl: contentUrl,
neighboringContentUrls: neighboringContentUrls,
nonPersonalizedAds: nonPersonalizedAds,
httpTimeoutMillis: httpTimeoutMillis,
mediationExtrasIdentifier: mediationExtrasIdentifier,
extras: extras,
),
size: adSize,
/// bannerAd size as per need
listener: BannerAdListener(
onAdClicked: onAdClicked,
onPaidEvent: onPaidEvent,
/// Called when an BannerAd is successfully received.
onAdLoaded: onAdLoaded,
/// Called when an BannerAd request failed.
onAdFailedToLoad: onAdFailedToLoad,
/// Called when an BannerAd opens an overlay that covers the screen.
onAdOpened: onAdOpened,
/// Called when an BannerAd removes an overlay that covers the screen.
onAdClosed: onAdClosed,
/// Called when an impression occurs on the BannerAd.
onAdImpression: onAdImpression,
/// For iOS only. Called before dismissing a full screen view.
onAdWillDismissScreen: onAdWillDismissScreen,
),
);
bannerAd.load();
}