copyWith method

Customer copyWith({
  1. int? id,
  2. String? firstName,
  3. String? lastName,
  4. String? email,
  5. String? customerCode,
  6. String? phone,
  7. Map<String, dynamic>? metadata,
})

Returns a copy of this Customer with the specified fields replaced.

Implementation

Customer copyWith({
  int? id,
  String? firstName,
  String? lastName,
  String? email,
  String? customerCode,
  String? phone,
  Map<String, dynamic>? metadata,
}) {
  return Customer(
    id: id ?? this.id,
    firstName: firstName ?? this.firstName,
    lastName: lastName ?? this.lastName,
    email: email ?? this.email,
    customerCode: customerCode ?? this.customerCode,
    phone: phone ?? this.phone,
    metadata: metadata ?? this.metadata,
  );
}