copyWith method

ProductData copyWith({
  1. int? id,
  2. String? name,
  3. double? price,
  4. bool? active,
  5. Value<String?> imagePath = const Value.absent(),
  6. int? categoryId,
  7. double? estimatedInputPrice,
  8. double? taxRate,
  9. Value<String?> description = const Value.absent(),
})

Implementation

ProductData copyWith({
  int? id,
  String? name,
  double? price,
  bool? active,
  Value<String?> imagePath = const Value.absent(),
  int? categoryId,
  double? estimatedInputPrice,
  double? taxRate,
  Value<String?> description = const Value.absent(),
}) => ProductData(
  id: id ?? this.id,
  name: name ?? this.name,
  price: price ?? this.price,
  active: active ?? this.active,
  imagePath: imagePath.present ? imagePath.value : this.imagePath,
  categoryId: categoryId ?? this.categoryId,
  estimatedInputPrice: estimatedInputPrice ?? this.estimatedInputPrice,
  taxRate: taxRate ?? this.taxRate,
  description: description.present ? description.value : this.description,
);