copyWith method

  1. @override
FastPlanBlocState copyWith({
  1. bool? isPlanPurchasePending,
  2. bool? hasPurchasedPlan,
  3. bool? isRestoringPlan,
  4. String? planId,
  5. dynamic error,
})
override

Creates a copy of this TModel but with the given fields replaced with the new values.

For example:

var myModel2 = myModel1.copyWith(age: 42);

Implementation

@override
FastPlanBlocState copyWith({
  bool? isPlanPurchasePending,
  bool? hasPurchasedPlan,
  bool? isRestoringPlan,
  String? planId,
  dynamic error,
}) {
  return FastPlanBlocState(
    hasPurchasedPlan: hasPurchasedPlan ?? this.hasPurchasedPlan,
    isRestoringPlan: isRestoringPlan ?? this.isRestoringPlan,
    planId: planId ?? this.planId,
    error: error,
    isPlanPurchasePending:
        isPlanPurchasePending ?? this.isPlanPurchasePending,
  );
}