copyWith method

SupplierData copyWith({
  1. int? id,
  2. String? name,
  3. bool? active,
  4. String? email,
  5. Value<String?> address = const Value.absent(),
  6. Value<String?> phone = const Value.absent(),
  7. Value<String?> description = const Value.absent(),
  8. int? supplierTypeId,
  9. Value<String?> imagePath = const Value.absent(),
})

Implementation

SupplierData copyWith({
  int? id,
  String? name,
  bool? active,
  String? email,
  Value<String?> address = const Value.absent(),
  Value<String?> phone = const Value.absent(),
  Value<String?> description = const Value.absent(),
  int? supplierTypeId,
  Value<String?> imagePath = const Value.absent(),
}) => SupplierData(
  id: id ?? this.id,
  name: name ?? this.name,
  active: active ?? this.active,
  email: email ?? this.email,
  address: address.present ? address.value : this.address,
  phone: phone.present ? phone.value : this.phone,
  description: description.present ? description.value : this.description,
  supplierTypeId: supplierTypeId ?? this.supplierTypeId,
  imagePath: imagePath.present ? imagePath.value : this.imagePath,
);