handlePlanPurchasedEvent method

Stream<FastPlanBlocState> handlePlanPurchasedEvent(
  1. String productId
)

Implementation

Stream<FastPlanBlocState> handlePlanPurchasedEvent(String productId) async* {
  if (_isPurchasePending) {
    debugLog('Plan purchased: $productId');

    _isPurchasePending = false;

    await _enablePlan(productId);

    yield currentState.copyWith(
      isPlanPurchasePending: false,
      hasPurchasedPlan: true,
      planId: productId,
    );
  }
}