copyWithCompanion method

Course copyWithCompanion(
  1. CoursesCompanion data
)

Implementation

Course copyWithCompanion(CoursesCompanion data) {
  return Course(
    id: data.id.present ? data.id.value : this.id,
    fetchedAt: data.fetchedAt.present ? data.fetchedAt.value : this.fetchedAt,
    code: data.code.present ? data.code.value : this.code,
    credits: data.credits.present ? data.credits.value : this.credits,
    hours: data.hours.present ? data.hours.value : this.hours,
    nameEn: data.nameEn.present ? data.nameEn.value : this.nameEn,
    nameZh: data.nameZh.present ? data.nameZh.value : this.nameZh,
    descriptionEn: data.descriptionEn.present
        ? data.descriptionEn.value
        : this.descriptionEn,
    descriptionZh: data.descriptionZh.present
        ? data.descriptionZh.value
        : this.descriptionZh,
  );
}