HeartbeatUtils class

Calls onBeat every interval until stop or dispose is called.

Constructors

HeartbeatUtils(Duration interval, void onBeat())
Creates a heartbeat that invokes onBeat every interval once start is called. Audited: 2026-06-12 11:26 EDT

Properties

hashCode int
The hash code for this object.
no setterinherited
interval Duration
Interval between heartbeat callbacks. Audited: 2026-06-12 11:26 EDT
no setter
onBeat → void Function()
Callback invoked every interval while running. Audited: 2026-06-12 11:26 EDT
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Releases the timer; call when the heartbeat is no longer needed. Audited: 2026-06-12 11:26 EDT
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() → void
Starts the periodic heartbeat; cancels any existing timer. Audited: 2026-06-12 11:26 EDT
stop() → void
Stops the heartbeat and cancels the timer. Audited: 2026-06-12 11:26 EDT
toString() String
A string representation of this object.
override

Operators

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