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
Methods
-
advance(
[Duration delta = Duration.zero]) → DateTime -
Moves the clock forward by
deltaand returns the updated time. -
advanceAnimationTick(
Object controllerId, [Duration delta = Duration.zero]) → AnimationTickMsg -
Advances by
deltaand returns an AnimationTickMsg at the new time. -
animationTick(
Object controllerId) → AnimationTickMsg -
Returns an AnimationTickMsg for
controllerIdat 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