copyWith method

TicketWeebi copyWith({
  1. String? firmIdAndBoutiqueId,
  2. int? id,
  3. int? shopId,
  4. List<ItemCartWeebi<ArticleRawAbstract>>? items,
  5. TaxWeebi? taxe,
  6. double? promo,
  7. num? discountAmount,
  8. String? comment,
  9. num? received,
  10. DateTime? date,
  11. PaymentType? paymentType,
  12. TicketType? ticketType,
  13. int? contactId,
  14. String? contactFirstName,
  15. String? contactLastName,
  16. String? contactPhone,
  17. String? contactMail,
  18. bool? status,
  19. DateTime? statusUpdateDate,
  20. DateTime? creationDate,
})

Implementation

TicketWeebi copyWith({
  String? firmIdAndBoutiqueId,
  int? id,
  int? shopId,
  List<ItemCartWeebi>? items,
  TaxWeebi? taxe,
  double? promo,
  num? discountAmount,
  String? comment,
  num? received,
  DateTime? date,
  PaymentType? paymentType,
  TicketType? ticketType,
  int? contactId,
  String? contactFirstName,
  String? contactLastName,
  String? contactPhone,
  String? contactMail,
  bool? status,
  DateTime? statusUpdateDate,
  DateTime? creationDate,
}) {
  return TicketWeebi(
    firmIdAndBoutiqueId: firmIdAndBoutiqueId ?? this.firmIdAndBoutiqueId,
    id: id ?? this.id,
    items: items ??
        this.items.map((e) => e).toList(), // a real copy, not a reference
    taxe: taxe ?? this.taxe,
    promo: promo ?? this.promo,
    comment: comment ?? this.comment,
    received: received ?? this.received,
    date: date ?? this.date,
    paymentType: paymentType ?? this.paymentType,
    ticketType: ticketType ?? this.ticketType,
    contactId: contactId ?? this.contactId,
    contactFirstName: contactFirstName ?? this.contactFirstName,
    contactLastName: contactLastName ?? this.contactLastName,
    contactPhone: contactPhone ?? this.contactPhone,
    contactMail: contactMail ?? this.contactMail,
    status: status ?? this.status,
    statusUpdateDate: statusUpdateDate ?? this.statusUpdateDate,
    creationDate: creationDate ?? this.creationDate,
    discountAmount: discountAmount ?? this.discountAmount,
  );
}