handlePurchasePlanEvent method

Stream<FastPlanBlocState> handlePurchasePlanEvent(
  1. String productId
)

Implementation

Stream<FastPlanBlocState> handlePurchasePlanEvent(String productId) async* {
  if (!_isRestoringPlan && !_isPurchasePending) {
    debugLog('Purchase plan: $productId');

    _isPurchasePending = true;
    yield currentState.copyWith(isPlanPurchasePending: true);

    _fastStoreBloc.addEvent(FastStoreBlocEvent.purchaseProduct(productId));
  }
}