copyWith method

EmployeeData copyWith({
  1. int? id,
  2. String? empNumber,
  3. String? name,
  4. String? email,
  5. int? employeePositionId,
  6. int? departmentId,
  7. DateTime? birthday,
  8. DateTime? hireDate,
  9. Value<String?> imagePath = const Value.absent(),
  10. Value<String?> address = const Value.absent(),
})

Implementation

EmployeeData copyWith({
  int? id,
  String? empNumber,
  String? name,
  String? email,
  int? employeePositionId,
  int? departmentId,
  DateTime? birthday,
  DateTime? hireDate,
  Value<String?> imagePath = const Value.absent(),
  Value<String?> address = const Value.absent(),
}) => EmployeeData(
  id: id ?? this.id,
  empNumber: empNumber ?? this.empNumber,
  name: name ?? this.name,
  email: email ?? this.email,
  employeePositionId: employeePositionId ?? this.employeePositionId,
  departmentId: departmentId ?? this.departmentId,
  birthday: birthday ?? this.birthday,
  hireDate: hireDate ?? this.hireDate,
  imagePath: imagePath.present ? imagePath.value : this.imagePath,
  address: address.present ? address.value : this.address,
);