FakeClock class final
A Clock whose value is advanced by the caller. Used everywhere in animation tests; never use SystemClock in tests.
final clock = FakeClock();
// ... wire clock into a TickerScheduler / Ticker / etc.
clock.advance(const Duration(milliseconds: 100));
// any ticker is now 100ms further along its timeline.
- Implemented types
Properties
Methods
-
advance(
Duration delta) → void -
Advances the clock by
delta. Assertsdeltais non-negative to preserve the monotonic-time invariant. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
Duration time) → void -
Sets the clock to
time. Asserts that the new value is at least as large as the current value. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited