stop method

void stop()

Stops the Word Counter and resets the counts.

Implementation

void stop() {
  if (!isRunning) {
    return;
  }

  _documentTimer?.cancel();
  _documentTimer = null;
  _selectionTimer?.cancel();
  _selectionTimer = null;
  _streamSubscription?.cancel();
  _documentCounters = const Counters();
  _selectionCounters = const Counters();
  isRunning = false;

  notifyListeners();
}