dispatchInterstitialEvent function

bool dispatchInterstitialEvent(
  1. PrebidInterstitialAdListener? listener,
  2. String event,
  3. Map? args
)

Calls the listener callback for an interstitial event. Returns whether the event is one of PrebidInterstitialAdListener's.

Implementation

bool dispatchInterstitialEvent(
  PrebidInterstitialAdListener? listener,
  String event,
  Map? args,
) {
  switch (event) {
    case 'onAdLoaded':
      listener?.onAdLoaded?.call();
    case 'onAdFailed':
      listener?.onAdFailed?.call(adEventError(args));
    case 'onAdDisplayed':
      listener?.onAdDisplayed?.call();
    case 'onAdClosed':
      listener?.onAdClosed?.call();
    case 'onAdClicked':
      listener?.onAdClicked?.call();
    case 'onAdExpired':
      listener?.onAdExpired?.call();
    case 'onAdImpression':
      listener?.onAdImpression?.call();
    default:
      return false;
  }
  return true;
}