copyWith method

CourseDraftState copyWith({
  1. CourseFiles? files,
  2. Course? course,
  3. List<CourseIssue>? issues,
  4. String? lessonId,
  5. bool? loading,
})

Não serve para limpar um campo que já tem valor (a lição, o curso): quem precisa de null monta o estado inteiro.

Implementation

CourseDraftState copyWith({
  CourseFiles? files,
  Course? course,
  List<CourseIssue>? issues,
  String? lessonId,
  bool? loading,
}) => CourseDraftState(
  files: files ?? this.files,
  course: course ?? this.course,
  issues: issues ?? this.issues,
  lessonId: lessonId ?? this.lessonId,
  loading: loading ?? this.loading,
);