copyWith method

ScoreDetail copyWith({
  1. int? id,
  2. int? user,
  3. int? semester,
  4. Value<int?> score = const Value.absent(),
  5. Value<ScoreStatus?> status = const Value.absent(),
  6. String? code,
  7. String? nameZh,
  8. Value<String?> number = const Value.absent(),
})

Implementation

ScoreDetail copyWith({
  int? id,
  int? user,
  int? semester,
  Value<int?> score = const Value.absent(),
  Value<ScoreStatus?> status = const Value.absent(),
  String? code,
  String? nameZh,
  Value<String?> number = const Value.absent(),
}) => ScoreDetail(
  id: id ?? this.id,
  user: user ?? this.user,
  semester: semester ?? this.semester,
  score: score.present ? score.value : this.score,
  status: status.present ? status.value : this.status,
  code: code ?? this.code,
  nameZh: nameZh ?? this.nameZh,
  number: number.present ? number.value : this.number,
);