call method

  1. @defineHook
TimerHook call(
  1. Duration duration,
  2. void callback(), {
  3. bool immediately = false,
})

Creates a one-shot timer that invokes callback after duration.

Returns a TimerHook; call TimerHook.cancel to cancel before it fires.

Implementation

@defineHook
TimerHook call(Duration duration, void Function() callback,
    {bool immediately = false}) {
  return useHook(_TimerHook(
      duration: duration, callback: callback, immediately: immediately));
}