reset method
Resets the sleep timer with an optional new duration
.
Implementation
void reset([Duration? duration]) {
_target = duration ?? this.duration;
_prediction?.cancel();
_timer?.cancel();
if (isRunning) {
_prediction = Timer.periodic(periodicTime, _counter);
_timer = Timer(_target, _complete);
} else {
_remaining(_target.use);
}
}