handleAdError method

Handles the event when an ad loading or showing error occurs.

Implementation

Stream<FastRewardedAdBlocState> handleAdError(
  FastRewardedAdBlocEventPayload payload,
) async* {
  debugLog(
    'Ad error: ${payload.error}. Request id: ${currentState.requestId}',
    debugLabel: debugLabel,
  );

  yield currentState.copyWith(
    error: payload.error,
    hasDismissedAd: false,
    isShowingAd: false,
    isLoadingAd: false,
    hasLoadedAd: false,
  );
}