BannerAd constructor

BannerAd({
  1. Key? key,
  2. String placementId = BannerAd.testPlacementId,
  3. BannerSize bannerSize = BannerSize.STANDARD,
  4. BannerAdListener? listener,
  5. bool keepAlive = false,
})

This widget is used to contain Banner Ads. listener is used to monitor Banner Ad. BannerAdResult is passed to the callback function along with other information based on result such as placement id, error code, error message, click info etc.

Information will generally be of type Map with details such as:

{
  'placement\_id': "YOUR\_PLACEMENT\_ID",
  'invalidated': false,
  'error\_code': 2,
  'error\_message': "No internet connection",
}

Implementation

BannerAd({
  this.key,
  this.placementId = BannerAd.testPlacementId,
  this.bannerSize = BannerSize.STANDARD,
  this.listener,
  this.keepAlive = false,
}) : super(key: key);