call method

void call(
  1. void action()
)

Calls the function after the specified delay duration.

If another call is made before the delay duration has passed, the previous call is cancelled, and the timer is reset.

Implementation

void call(void Function() action) {
  _timer?.cancel();
  _timer = Timer(delay, action);
}