loadAd method

Future<void> loadAd()

Implementation

Future<void> loadAd() async {
  if(kIsWeb) {
    Log('DocereeAdView').i('Direct Web');
    request?.loadAd().then((value) => setAdResponse(value));
  } else {
    SizeConfig().init(context);
    bool isIpad = await SizeConfig.isTablet(context);
    if(isIpad == false && (getAdTypeBySize(widget.adSize) == AdType.fullSize || getAdTypeBySize(widget.adSize) == AdType.leaderboard)) {
      Log(tag).i("Invalid Request. Ad size will not fit on screen");
      return;
    } else {
      request?.loadAd().then((value) => setAdResponse(value));
    }
  }
}