getBannerAd method

  1. @override
Widget getBannerAd()
override

Implementation

@override
Widget getBannerAd() {
  return NativeAd(
    placementId: GlobalAdVariables.adNetworkIds?['facebook']?.bannerId ?? "",
    adType: NativeAdType.NATIVE_BANNER_AD,
    bannerAdSize: NativeBannerAdSize.HEIGHT_100,
    width: double.infinity,
    backgroundColor: Colors.blue,
    titleColor: Colors.white,
    descriptionColor: Colors.white,
    buttonColor: Colors.deepPurple,
    buttonTitleColor: Colors.white,
    buttonBorderColor: Colors.white,
    listener: NativeAdListener(
      onError: (code, message) => log('facebook:[Banner]->error'),
      onLoaded: () => log('facebook:[Banner]->loaded'),
      onClicked: () => log('facebook:[Banner]->clicked'),
      onLoggingImpression: () => log('facebook:[Banner]->logging impression'),
      onMediaDownloaded: () => log('facebook:[Banner]->media downloaded'),
    ),
  );
}