ManualClock class final

A manually advanced clock intended for deterministic tests.

The clock never moves unless advance or set is called, making it useful for animation, replay, and frame-recording tests that should not depend on wall-clock timing.

Constructors

ManualClock({DateTime? initialTime})
Creates a manual clock seeded at initialTime.

Properties

hashCode int
The hash code for this object.
no setterinherited
now DateTime
The current clock time.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

advance([Duration delta = Duration.zero]) DateTime
Moves the clock forward by delta and returns the updated time.
advanceAnimationTick(Object controllerId, [Duration delta = Duration.zero]) AnimationTickMsg
Advances by delta and returns an AnimationTickMsg at the new time.
animationTick(Object controllerId) AnimationTickMsg
Returns an AnimationTickMsg for controllerId at the current time.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(DateTime time) → void
Sets the clock to an explicit time.
toString() String
A string representation of this object.
inherited

Operators

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