showAd static method
dynamic
showAd({
- NetworkType? networkType,
- AdsType? adsType,
- AdModuleWithCallBacks? adModuleWithCallBacks,
Implementation
static showAd({
NetworkType? networkType,
AdsType? adsType,
AdModuleWithCallBacks? adModuleWithCallBacks,
}) {
if (networkType == NetworkType.None) {
if (adModuleWithCallBacks != null) {
if (adModuleWithCallBacks.onCloseEvent != null) {
adModuleWithCallBacks.onCloseEvent!();
}
}
return;
}
if (GlobalAdVariables.adNetworks != null) {
if (GlobalAdVariables.adNetworks![networkType] != null) {
if (adsType != null) {
switch (adsType) {
case AdsType.inter:
GlobalAdVariables.adNetworks![networkType]!.loadAndShowInterAd(
adModuleCallBacks: adModuleWithCallBacks,
);
break;
case AdsType.reward:
GlobalAdVariables.adNetworks![networkType]!.loadAndShowRewardAd(
adModuleCallBacks: adModuleWithCallBacks,
);
break;
case AdsType.rewardInter:
GlobalAdVariables.adNetworks![networkType]!
.loadAndShowRewardInter(
adModuleCallBacks: adModuleWithCallBacks,
);
break;
default:
GlobalAdVariables.adNetworks![networkType]!.loadAndShowInterAd(
adModuleCallBacks: adModuleWithCallBacks,
);
break;
}
}
}
}
}