GgFakeTimer class

A fake timer class

Implemented types

Constructors

GgFakeTimer(Duration interval, void callback(), {required bool isPeriodic})
Create a normal timer
GgFakeTimer.periodic(Duration duration, void callback(Timer timer))
Create a periodic timer
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
interval Duration
Interval
final
isActive bool
Returns true if timer is still active
no setteroverride
isCancelled bool
Returns true if timer is cancelled
no setter
isPeriodic bool
Returns true if timer is a periodic timer
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tick int
Current ticks
no setteroverride

Methods

cancel() → void
Cancel timer
override
elapse(Duration progress) → void
Fake elapsed milliseconds -> Will trigger timer
fire() → void
Returns the elapsed time
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

run(void callback()) → void
Create an immediately executing single shot timer
override