copyWith method

QuizState copyWith({
  1. List<Question>? questions,
  2. int? currentIndex,
  3. int? score,
  4. bool? isFinished,
  5. int? timeLeft,
})

Implementation

QuizState copyWith({
  List<Question>? questions,
  int? currentIndex,
  int? score,
  bool? isFinished,
  int? timeLeft,
}) {
  return QuizState(
    questions: questions ?? this.questions,
    currentIndex: currentIndex ?? this.currentIndex,
    score: score ?? this.score,
    isFinished: isFinished ?? this.isFinished,
    timeLeft: timeLeft ?? this.timeLeft,
  );
}