copyWith method
Creates a copy of this Product
instance where the only changes are those
specified in the parameters of this method.
Implementation
Product copyWith({
String? brand,
String? category,
Money? cost,
String? description,
String? id,
String? name,
Country? origin,
Money? price,
}) =>
Product(
brand: brand ?? this.brand,
category: category ?? this.category,
cost: cost ?? this.cost,
description: description ?? this.description,
id: id ?? this.id,
name: name ?? this.name,
origin: origin ?? this.origin,
price: price ?? this.price,
);