getNativeAd method

  1. @override
Widget getNativeAd()
override

Implementation

@override
Widget getNativeAd() {
  return NativeAd(
    placementId: GlobalAdVariables.adNetworkIds?['facebook']?.nativeId ?? "",
    adType: NativeAdType.NATIVE_AD,
    width: double.infinity,
    height: 300,
    backgroundColor: Colors.blue,
    titleColor: Colors.white,
    descriptionColor: Colors.white,
    buttonColor: Colors.deepPurple,
    buttonTitleColor: Colors.white,
    buttonBorderColor: Colors.white,
    keepAlive: true,
    keepExpandedWhileLoading: false,
    expandAnimationDuraion: 300,
    listener: NativeAdListener(
      onError: (code, message) => log('facebook:[Native]->error'),
      onLoaded: () => log('facebook:[Native]->loaded'),
      onClicked: () => log('facebook:[Native]->clicked'),
      onLoggingImpression: () => log('facebook:[Native]->logging impression'),
      onMediaDownloaded: () => log('facebook:[Native]->media downloaded'),
    ),
  );
}