TickMsg class
Message sent when a timer tick occurs.
Created by Cmd.tick or Cmd.every commands.
Contains the time when the tick occurred and an optional
identifier for distinguishing between multiple timers.
Example
@override
Cmd? init() => Cmd.tick(Duration(seconds: 1), (_) => TickMsg(DateTime.now()));
@override
(Model, Cmd?) update(Msg msg) {
return switch (msg) {
TickMsg(:final time) => (
copyWith(lastTick: time),
Cmd.tick(Duration(seconds: 1), (_) => TickMsg(DateTime.now())),
),
_ => (this, null),
};
}
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override