handleLoadSplashAdEvent method

Stream<FastSplashAdBlocState> handleLoadSplashAdEvent()

Loads the splash ad.

Implementation

Stream<FastSplashAdBlocState> handleLoadSplashAdEvent() async* {
  yield currentState.copyWith(
    isAdLoaded: false,
    isAdLoading: true,
  );

  var isAdDisplayable = false;

  if (canShowAd) isAdDisplayable = await _service!.loadAd();

  yield currentState.copyWith(
    isAdDisplayable: isAdDisplayable,
    isAdLoading: false,
    isAdLoaded: true,
  );
}