TimerHookCreator class final

Hook factory for creating one-shot or periodic timers in Setup components.

Usage:

  • One-shot: useTimer invokes callback once after duration.
  • Periodic: useTimer.periodic invokes callback every duration; cancel via the returned TimerHook.

When immediately is true, the timer is started during build; when false, after mount. The timer is cancelled automatically when the component unmounts.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(Duration duration, void callback(), {bool immediately = false}) TimerHook
Creates a one-shot timer that invokes callback after duration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
periodic(Duration duration, void callback(Timer timer), {bool immediately = false}) TimerHook
Creates a periodic timer that invokes callback every duration.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited