cancel method

void cancel()

Cancels any active timer and clears the currently scheduled action.

This can be used to prevent the scheduled action from executing if it is no longer needed.

Implementation

void cancel() {
  _timer?.cancel();
  _action = null;
}