showScreenBasedNative static method
Implementation
static Widget showScreenBasedNative(BuildContext context) {
if (GlobalAdVariables.isPremiumUser) {
return const SizedBox();
}
if (!GlobalAdVariables.globalAdFlag) {
return const SizedBox();
}
final currentRoute = RouteMethods().getCurrentRoute(context);
log("MultiAds:[showScreenBasedNative]->RouteManager->$currentRoute");
AdConfigDataModel adConfig =
GlobalAdVariables.screenAdJson?[currentRoute] ??
GlobalAdVariables.screenAdJson!["default"]!;
if (adConfig.showAds) {
switch (adConfig.native) {
case 1:
return AdClass.showNativeBasedOnScreen(NetworkType.google);
case 2:
return AdClass.showNativeBasedOnScreen(NetworkType.unity);
case 3:
return AdClass.showNativeBasedOnScreen(NetworkType.yodoMas);
default:
return const SizedBox();
}
}
return const SizedBox();
}