copyWith method
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,
);
}