showAd static method

dynamic showAd({
  1. NetworkType? networkType,
  2. AdsType? adsType,
  3. 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;
        }
      }
    }
  }
}