resetPattern method

void resetPattern()

Resets the pattern matching process and cancels the current timer.

This method should be called when a mismatch occurs or when the pattern needs to be restarted.

Implementation

void resetPattern() {
  _currentIndex = 0;
  _timer?.cancel();
  _stopwatch.reset();
}