EveryCmd class

A repeating command that fires at regular intervals.

The interval is synchronized to wall-clock time (e.g., if interval is 1 second, it fires at :00, :01, :02, etc.).

Inheritance
Available extensions

Constructors

EveryCmd({required Duration interval, required Msg? callback(DateTime time), Object? id})

Properties

callback Msg? Function(DateTime time)
The callback to create messages on each tick.
final
hashCode int
The hash code for this object.
no setterinherited
id Object?
Optional identifier for this timer.
final
interval Duration
The interval between ticks.
final
isActive bool
Whether the timer is active.
no setter
isActive bool

Available on Cmd?, provided by the CmdExtension extension

Returns true if this command is non-null and not a no-op.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute() Future<Msg?>
Executes the command and returns the resulting message (if any).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orNone() Cmd

Available on Cmd?, provided by the CmdExtension extension

Returns the command or Cmd.none() if null.
start(void sendMessage(Msg)) → void
Starts the repeating timer.
stop() → void
Stops the repeating timer.
toString() String
A string representation of this object.
inherited

Operators

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