cancel method

void cancel({
  1. bool fromConstructor = false,
})

Chancels this countdown.

Implementation

void cancel({bool fromConstructor = false}) {
  _timer?.cancel();
  _timer = null;
  _currentDuration = duration;
  _currentSecondsToSubtract = secondsToSubtract;
  if (!fromConstructor) {
    for (CountdownListener listener in listeners) {
      listener.onCancelled();
    }
  }
}