copyWith method

Invoice copyWith({
  1. String? currency,
  2. List<LabeledPricePart>? priceParts,
  3. int? maxTipAmount,
  4. List<int>? suggestedTipAmounts,
  5. String? recurringPaymentTermsOfServiceUrl,
  6. String? termsOfServiceUrl,
  7. bool? isTest,
  8. bool? needName,
  9. bool? needPhoneNumber,
  10. bool? needEmailAddress,
  11. bool? needShippingAddress,
  12. bool? sendPhoneNumberToProvider,
  13. bool? sendEmailAddressToProvider,
  14. bool? isFlexible,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

Invoice copyWith({
  String? currency,
  List<LabeledPricePart>? priceParts,
  int? maxTipAmount,
  List<int>? suggestedTipAmounts,
  String? recurringPaymentTermsOfServiceUrl,
  String? termsOfServiceUrl,
  bool? isTest,
  bool? needName,
  bool? needPhoneNumber,
  bool? needEmailAddress,
  bool? needShippingAddress,
  bool? sendPhoneNumberToProvider,
  bool? sendEmailAddressToProvider,
  bool? isFlexible,
}) =>
    Invoice(
      currency: currency ?? this.currency,
      priceParts: priceParts ?? this.priceParts,
      maxTipAmount: maxTipAmount ?? this.maxTipAmount,
      suggestedTipAmounts: suggestedTipAmounts ?? this.suggestedTipAmounts,
      recurringPaymentTermsOfServiceUrl: recurringPaymentTermsOfServiceUrl ??
          this.recurringPaymentTermsOfServiceUrl,
      termsOfServiceUrl: termsOfServiceUrl ?? this.termsOfServiceUrl,
      isTest: isTest ?? this.isTest,
      needName: needName ?? this.needName,
      needPhoneNumber: needPhoneNumber ?? this.needPhoneNumber,
      needEmailAddress: needEmailAddress ?? this.needEmailAddress,
      needShippingAddress: needShippingAddress ?? this.needShippingAddress,
      sendPhoneNumberToProvider:
          sendPhoneNumberToProvider ?? this.sendPhoneNumberToProvider,
      sendEmailAddressToProvider:
          sendEmailAddressToProvider ?? this.sendEmailAddressToProvider,
      isFlexible: isFlexible ?? this.isFlexible,
    );