nextStroke method

void nextStroke()

Implementation

void nextStroke() {
  if (!_isQuizzing) {
    if (currentStroke == strokeOrder.nStrokes) {
      _setCurrentStroke(1);
    } else if (_isAnimating) {
      _setCurrentStroke(currentStroke + 1);
      _strokeAnimationController.reset();

      if (currentStroke < strokeOrder.nStrokes) {
        _strokeAnimationController.forward();
      } else {
        _isAnimating = false;
      }
    } else {
      if (currentStroke < strokeOrder.nStrokes) {
        _setCurrentStroke(currentStroke + 1);
      }
    }

    notifyListeners();
  }
}