BannerAd constructor
BannerAd({
- required String adUnitId,
- required BannerAdSize adSize,
- AdRequest? adRequest,
- void onAdLoaded()?,
- void onAdFailedToLoad(
- AdRequestError error
- void onAdClicked()?,
- void onLeftApplication()?,
- void onReturnedToApplication()?,
- void onImpression(
- ImpressionData impressionData
Implementation
BannerAd({
required String adUnitId,
required this.adSize,
this.adRequest,
void Function()? onAdLoaded,
void Function(AdRequestError error)? onAdFailedToLoad,
void Function()? onAdClicked,
void Function()? onLeftApplication,
void Function()? onReturnedToApplication,
void Function(ImpressionData impressionData)? onImpression,
}) : _adUnitId = adUnitId {
_channel = MethodChannel('$_channelPath.$_id');
_eventListener = _BannerAdEventListener(
channelName: '$_channelPath.$_id.events',
onAdLoaded: onAdLoaded,
onAdFailedToLoad: onAdFailedToLoad,
onAdClicked: onAdClicked,
onLeftApplication: onLeftApplication,
onReturnedToApplication: onReturnedToApplication,
onImpression: onImpression,
);
}