copyWith method

Course copyWith({
  1. int? id,
  2. Value<DateTime?> fetchedAt = const Value.absent(),
  3. String? code,
  4. double? credits,
  5. int? hours,
  6. Value<String?> nameEn = const Value.absent(),
  7. Value<String?> nameZh = const Value.absent(),
  8. Value<String?> descriptionEn = const Value.absent(),
  9. Value<String?> descriptionZh = const Value.absent(),
})

Implementation

Course copyWith({
  int? id,
  Value<DateTime?> fetchedAt = const Value.absent(),
  String? code,
  double? credits,
  int? hours,
  Value<String?> nameEn = const Value.absent(),
  Value<String?> nameZh = const Value.absent(),
  Value<String?> descriptionEn = const Value.absent(),
  Value<String?> descriptionZh = const Value.absent(),
}) => Course(
  id: id ?? this.id,
  fetchedAt: fetchedAt.present ? fetchedAt.value : this.fetchedAt,
  code: code ?? this.code,
  credits: credits ?? this.credits,
  hours: hours ?? this.hours,
  nameEn: nameEn.present ? nameEn.value : this.nameEn,
  nameZh: nameZh.present ? nameZh.value : this.nameZh,
  descriptionEn: descriptionEn.present
      ? descriptionEn.value
      : this.descriptionEn,
  descriptionZh: descriptionZh.present
      ? descriptionZh.value
      : this.descriptionZh,
);