handlePlanRestoredEvent method

Stream<FastPlanBlocState> handlePlanRestoredEvent(
  1. String productId
)

Implementation

Stream<FastPlanBlocState> handlePlanRestoredEvent(String productId) async* {
  if (_isRestoringPlan) {
    debugLog('Plan restored: $productId');

    await _enablePlan(productId);

    _isRestoringPlan = false;
    _pendingPlanRestoring = null;

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