ManualEffectClock class final

Deterministic EffectClock controlled by the test.

Sleeps complete only when advance or advanceTo reaches their deadline. Cancellation removes the pending sleep without advancing time.

Implemented types

Constructors

ManualEffectClock([DateTime? initialTime])

Properties

hashCode int
The hash code for this object.
no setterinherited
pendingDurations List<Duration>
Remaining durations in deadline order.
no setter
pendingSleepCount int
Number of sleeps currently waiting for manual time.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

advance(Duration duration) Future<void>
Move time forward and complete every sleep whose deadline was reached.
advanceTo(DateTime instant) Future<void>
Move time to instant and complete every due sleep.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
now() DateTime
Current host time.
override
sleep(Duration duration, CancellationSignal cancellation) Future<void>
Wait for duration while observing cancellation.
override
toString() String
A string representation of this object.
inherited

Operators

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