initBannerAd static method
Implementation
static BannerAd? initBannerAd(
Function onAdLoaded,
Function onAdFailedToLoad,
) {
if (isShowBanner == true) {
return BannerAd(
adUnitId: AdsInitialization.bannerId,
size: AdSize.fullBanner,
request: const AdRequest(),
listener: BannerAdListener(
onAdLoaded: (_) {
onAdLoaded();
},
onAdFailedToLoad: (ad, error) {
ad.dispose();
onAdFailedToLoad();
},
),
)..load();
} else {
return null;
}
}