copyWith method

ExerciseRoundState copyWith({
  1. int? roundNumber,
  2. bool? loading,
  3. Object? error = _manter,
  4. bool? running,
  5. Object? result = _manter,
  6. Object? verdict = _manter,
  7. Object? errors = _manter,
  8. Object? previousBest = _manter,
  9. bool? repeating,
  10. bool? startedRound,
  11. List<RoundResult>? history,
  12. Object? courseUse = _manter,
  13. Object? questionRound = _manter,
  14. ExerciseChartState? chart,
  15. int? serial,
})

Copia o estado. Os campos anuláveis aceitam null de propósito: quem não é passado fica como está.

Implementation

ExerciseRoundState copyWith({
  int? roundNumber,
  bool? loading,
  Object? error = _manter,
  bool? running,
  Object? result = _manter,
  Object? verdict = _manter,
  Object? errors = _manter,
  Object? previousBest = _manter,
  bool? repeating,
  bool? startedRound,
  List<RoundResult>? history,
  Object? courseUse = _manter,
  Object? questionRound = _manter,
  ExerciseChartState? chart,
  int? serial,
}) => ExerciseRoundState(
  roundNumber: roundNumber ?? this.roundNumber,
  loading: loading ?? this.loading,
  error: identical(error, _manter) ? this.error : error as String?,
  running: running ?? this.running,
  result: identical(result, _manter) ? this.result : result as RoundResult?,
  verdict: identical(verdict, _manter)
      ? this.verdict
      : verdict as PassVerdict?,
  errors: identical(errors, _manter) ? this.errors : errors as int?,
  previousBest: identical(previousBest, _manter)
      ? this.previousBest
      : previousBest as int?,
  repeating: repeating ?? this.repeating,
  startedRound: startedRound ?? this.startedRound,
  history: history ?? this.history,
  courseUse: identical(courseUse, _manter)
      ? this.courseUse
      : courseUse as CourseUse?,
  questionRound: identical(questionRound, _manter)
      ? this.questionRound
      : questionRound as QuestionRound?,
  chart: chart ?? this.chart,
  serial: serial ?? this.serial,
);