loadMrecAd static method
Loads an MREC (Medium Rectangle) ad.
Implementation
static BannerAd loadMrecAd(String id, {void Function()? onLoaded}) {
return BannerAd(
adUnitId: id,
size: AdSize.mediumRectangle,
request: const AdRequest(),
listener: BannerAdListener(
onAdLoaded: (ad) => onLoaded?.call(),
onAdFailedToLoad: (ad, error) {
LoggerUtil.e('MREC ad failed to load: $error');
ad.dispose();
},
),
)..load();
}