showNativeMediumWithLayout static method
Implementation
static Widget showNativeMediumWithLayout(
BuildContext context, NativeHolder nativeHolder) {
if (isTestDevice) {
return const SizedBox();
}
return FutureBuilder<bool>(
future: AdmobUtils.isNetworkConnected(),
builder: (context, snapshot) {
if (snapshot.hasData && snapshot.data == true) {
// If connected, display the native ad view.
return AdmobUtils.nativeView(
nativeHolder, NativeAdmobType.NATIVE_SMALL);
} else {
// If not connected or error, return an empty SizedBox.
return const SizedBox();
}
},
);
}