copyWith method

CourseTableSlot copyWith({
  1. int? id,
  2. Value<String?> number = const Value.absent(),
  3. int? semester,
  4. Value<String?> nameZh = const Value.absent(),
  5. Value<String?> nameEn = const Value.absent(),
  6. Value<double?> credits = const Value.absent(),
  7. Value<int?> hours = const Value.absent(),
  8. DayOfWeek? dayOfWeek,
  9. Period? period,
  10. Value<String?> classroomNameZh = const Value.absent(),
  11. Value<String?> classroomNameEn = const Value.absent(),
})

Implementation

CourseTableSlot copyWith({
  int? id,
  Value<String?> number = const Value.absent(),
  int? semester,
  Value<String?> nameZh = const Value.absent(),
  Value<String?> nameEn = const Value.absent(),
  Value<double?> credits = const Value.absent(),
  Value<int?> hours = const Value.absent(),
  DayOfWeek? dayOfWeek,
  Period? period,
  Value<String?> classroomNameZh = const Value.absent(),
  Value<String?> classroomNameEn = const Value.absent(),
}) => CourseTableSlot(
  id: id ?? this.id,
  number: number.present ? number.value : this.number,
  semester: semester ?? this.semester,
  nameZh: nameZh.present ? nameZh.value : this.nameZh,
  nameEn: nameEn.present ? nameEn.value : this.nameEn,
  credits: credits.present ? credits.value : this.credits,
  hours: hours.present ? hours.value : this.hours,
  dayOfWeek: dayOfWeek ?? this.dayOfWeek,
  period: period ?? this.period,
  classroomNameZh: classroomNameZh.present
      ? classroomNameZh.value
      : this.classroomNameZh,
  classroomNameEn: classroomNameEn.present
      ? classroomNameEn.value
      : this.classroomNameEn,
);