nativeView static method

Widget nativeView(
  1. NativeHolder nativeHolder,
  2. NativeAdmobType nativeType
)

Implementation

static Widget nativeView(
    NativeHolder nativeHolder, NativeAdmobType nativeType) {
  return ValueListenableBuilder<Pair>(
      valueListenable: nativeHolder.adsNativeController,
      builder: (context, snapshot, child) {
        if (snapshot.nativeAd != null) {
          return (snapshot.nativeAd!.responseInfo != null)
              ? (nativeType == NativeAdmobType.NATIVE_MEDIUM)
                  ? _viewNativeMedium(context, snapshot.nativeAd!)
                  : _viewNativeSmall(context, snapshot.nativeAd!)
              : const SizedBox(
                  height: 0,
                );
        } else {
          return (snapshot.msg == "no internet" || snapshot.msg == "error")
              ? const SizedBox(
                  height: 0,
                )
              : (nativeType == NativeAdmobType.NATIVE_MEDIUM)
                  ? const NativeShimmer()
                  : const BannerShimmer();
        }
      });
}