copyWith method

Product copyWith({
  1. String? id,
  2. double? price,
  3. String? name,
  4. bool? isAvailable,
  5. List<String>? images,
  6. int? max,
  7. Status? status,
  8. String? description,
  9. List<int>? counts,
  10. DateTime? createdAt,
})

Implementation

Product copyWith({
  String? id,
  double? price,
  String? name,
  bool? isAvailable,
  List<String>? images,
  int? max,
  Status? status,
  String? description,
  List<int>? counts,
  DateTime? createdAt,
}) {
  return Product(
    id: id ?? this.id,
    price: price ?? this.price,
    name: name ?? this.name,
    isAvailable: isAvailable ?? this.isAvailable,
    images: images ?? this.images,
    max: max ?? this.max,
    status: status ?? this.status,
    description: description ?? this.description,
    counts: counts ?? this.counts,
    createdAt: createdAt ?? this.createdAt,
  );
}