copyWith method

Invoice copyWith({
  1. String? customerName,
  2. String? invoiceNumber,
  3. DateTime? date,
  4. List<InvoiceItem>? items,
  5. double? tax,
  6. double? total,
  7. String? notes,
  8. String? template,
})

Implementation

Invoice copyWith({
  String? customerName,
  String? invoiceNumber,
  DateTime? date,
  List<InvoiceItem>? items,
  double? tax,
  double? total,
  String? notes,
  String? template,
}) {
  return Invoice(
    customerName: customerName ?? this.customerName,
    invoiceNumber: invoiceNumber ?? this.invoiceNumber,
    date: date ?? this.date,
    items: items ?? this.items,
    tax: tax ?? this.tax,
    total: total ?? this.total,
    notes: notes ?? this.notes,
    template: template ?? this.template,
  );
}