run method

void run(
  1. FutureOr<void> f(), {
  2. Duration? duration,
})

Schedules f to run after duration; resets the timer if called again.

Implementation

void run(FutureOr<void> Function() f, {Duration? duration}) {
  timer?.cancel();
  timer = Timer(duration ?? this.duration, f);
}