getCacheResultData method

LoadResultData? getCacheResultData(
  1. AdType adType
)

Implementation

LoadResultData? getCacheResultData(AdType adType){
  if(adType==AdType.interstitial){
    var cashAd = _newIntLoadIosAd?.getCashAd();
    "flutter ios ad --->get int cache--->ID: ${cashAd?.adBean.adId}--->revenue:${cashAd?.revenue}".log();
    return cashAd;
  }else if(adType==AdType.reward){
    if(!_priceSwitch){
      var cashAd = _newRvLoadIosAd?.getCashAd();
      "flutter ios ad --->get rv cache--->only contrast rv--->ID: ${cashAd?.adBean.adId}--->revenue:${cashAd?.revenue}".log();
      return cashAd;
    }else{
      var list = (_newIntLoadIosAd?.getHasCacheResultList()??[])+(_newRvLoadIosAd?.getHasCacheResultList()??[]);
      if(list.isEmpty){
        "flutter ios ad --->get rv cache--->contrast rv and int--->ID: no--->revenue: no".log();
        return null;
      }
      list.sort((a, b) => (b.revenue).compareTo(a.revenue));
      var first = list.first;
      "flutter ios ad --->get rv cache--->contrast rv and int--->ID: ${first.adBean.adId}--->revenue: ${first.revenue}".log();
      return first;
    }
  }else{
    return null;
  }
}