copyWith method

  1. @override
MessageInvoice copyWith({
  1. ProductInfo? productInfo,
  2. String? currency,
  3. int? totalAmount,
  4. String? startParameter,
  5. bool? isTest,
  6. bool? needShippingAddress,
  7. int? receiptMessageId,
  8. PaidMedia? paidMedia()?,
  9. FormattedText? paidMediaCaption()?,
})
override

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

Implementation

@override
MessageInvoice copyWith({
  ProductInfo? productInfo,
  String? currency,
  int? totalAmount,
  String? startParameter,
  bool? isTest,
  bool? needShippingAddress,
  int? receiptMessageId,
  PaidMedia? Function()? paidMedia,
  FormattedText? Function()? paidMediaCaption,
}) => MessageInvoice(
  productInfo: productInfo ?? this.productInfo,
  currency: currency ?? this.currency,
  totalAmount: totalAmount ?? this.totalAmount,
  startParameter: startParameter ?? this.startParameter,
  isTest: isTest ?? this.isTest,
  needShippingAddress: needShippingAddress ?? this.needShippingAddress,
  receiptMessageId: receiptMessageId ?? this.receiptMessageId,
  paidMedia: paidMedia != null ? paidMedia() : this.paidMedia,
  paidMediaCaption: paidMediaCaption != null
      ? paidMediaCaption()
      : this.paidMediaCaption,
);