Alarm class

Creates an alarm object that will run a callback, either at a given time or after a certain duration. The alarm will not start its' countdown until start is called if given a DateTime. If the duration is negative or the time to trigger on has already passed, the alarm will trigger immediatly

Properties

hashCode int
The hash code for this object.
no setterinherited
isActive bool
If the timer for this alarm is active, will return true
no setter
onDateTime bool
If the alarm is triggering on a time, or after a duration
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tick int
The tick of the alarm's timer
no setter
triggerAfter Duration
Returns the duration this timer will take to trigger, relative if using an alarm with a datetime
no setter
triggerAt DateTime
Returns the datetime that this timer will trigger at, relative if using an alarm with a duration
no setter

Methods

cancel() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() Alarm
Starts the alarm.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

after(Duration after, void callback()) Alarm
at(DateTime at, void callback()) Alarm
The alarm starts automatically when called
disableColors() → void
Disable the colors in the logs if your terminal does not support escape codes