copyWith method
Teacher
copyWith({ - int? id,
- Value<DateTime?> fetchedAt = const Value.absent(),
- String? code,
- int? semester,
- String? nameZh,
- Value<String?> nameEn = const Value.absent(),
- Value<String?> email = const Value.absent(),
- Value<int?> department = const Value.absent(),
- Value<String?> title = const Value.absent(),
- Value<double?> teachingHours = const Value.absent(),
- Value<String?> officeHoursNote = const Value.absent(),
})
Implementation
Teacher copyWith({
int? id,
Value<DateTime?> fetchedAt = const Value.absent(),
String? code,
int? semester,
String? nameZh,
Value<String?> nameEn = const Value.absent(),
Value<String?> email = const Value.absent(),
Value<int?> department = const Value.absent(),
Value<String?> title = const Value.absent(),
Value<double?> teachingHours = const Value.absent(),
Value<String?> officeHoursNote = const Value.absent(),
}) => Teacher(
id: id ?? this.id,
fetchedAt: fetchedAt.present ? fetchedAt.value : this.fetchedAt,
code: code ?? this.code,
semester: semester ?? this.semester,
nameZh: nameZh ?? this.nameZh,
nameEn: nameEn.present ? nameEn.value : this.nameEn,
email: email.present ? email.value : this.email,
department: department.present ? department.value : this.department,
title: title.present ? title.value : this.title,
teachingHours: teachingHours.present
? teachingHours.value
: this.teachingHours,
officeHoursNote: officeHoursNote.present
? officeHoursNote.value
: this.officeHoursNote,
);