Impure class abstract final

The impure inputs @Random, @Pick, @Shuffle, @Now and @Today read. A session's clock, random source and time zone apply while run runs its functions; otherwise these process-wide defaults apply, which tests may replace.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 Properties

fromLocal ↔ int Function(int wallMs)
The epoch milliseconds of a local wall-clock time, given as epoch milliseconds read as UTC: how JavaScript reads a date string without a time zone.
getter/setter pair
now ↔ DateTime Function()
Date.now().
getter/setter pair
random ↔ double Function()
Math.random(): a double in [0, 1).
getter/setter pair
toLocal ↔ DateTime Function(DateTime instant)
The local time zone JavaScript formats instants in. Tests use UTC, as the reference's vitest config does.
getter/setter pair

Static Methods

reset() → void
run<T>(T body(), {DateTime now()?, double random()?, OpenUiTimeZone? timeZone}) → T
Runs body with these inputs in place of the defaults; null keeps one.
useUtc() → void
Reads and formats dates in UTC, as the reference's tests run with TZ=UTC.