checkEndGame method

  1. @override
bool checkEndGame()
override

Returns true if :

  • The number of _goodAnswer is equal to the length of _questions
  • The number lives fall to 0

Implementation

@override
bool checkEndGame() {
  if (exerciseInfo != null && _goodAnswer == _questions.length) {
    apiBase.completeExercise(exerciseInfo!.id);
  }
  return (_goodAnswer == _questions.length || lives == 0);
}