copyWith method

CheckoutState copyWith({
  1. KeckPaymentMethod? paymentMethod,
  2. int? discountCents,
  3. int? tenderedCents,
  4. bool clearTendered = false,
  5. int? tipCents,
})

Implementation

CheckoutState copyWith({
  KeckPaymentMethod? paymentMethod,
  int? discountCents,
  int? tenderedCents,
  bool clearTendered = false,
  int? tipCents,
}) =>
    CheckoutState(
      paymentMethod: paymentMethod ?? this.paymentMethod,
      discountCents: discountCents ?? this.discountCents,
      tenderedCents: clearTendered ? null : (tenderedCents ?? this.tenderedCents),
      tipCents: tipCents ?? this.tipCents,
    );