Schedules f to run after duration; resets the timer if called again.
f
duration
void run(FutureOr<void> Function() f, {Duration? duration}) { timer?.cancel(); timer = Timer(duration ?? this.duration, f); }