isInterstitialAdLoaded method

bool isInterstitialAdLoaded({
  1. AdNetwork adNetwork = AdNetwork.any,
})

Returns bool indicating whether ad has been loaded

if adNetwork is provided, only that network's ad would be checked

Implementation

bool isInterstitialAdLoaded({AdNetwork adNetwork = AdNetwork.any}) {
  final ad = _interstitialAds.firstWhereOrNull((e) =>
      (adNetwork == AdNetwork.any || adNetwork == e.adNetwork) &&
      e.isAdLoaded);
  return ad?.isAdLoaded ?? false;
}