bifrostClock top-level property

DateTime Function() bifrostClock
getter/setter pair

The time source bifrosted reads.

Defaults to DateTime.now. Reassign it to make anything time-dependent deterministic — cache expiry here, and countdowns or "3 hours ago" labels in an app. A global rather than an injected dependency, matching bifrostJsonDecode and bifrostFakeSeed: it must work before any container exists, and every caller wants the same one.

This does not make expiry testable — seeding storage with a past timestamp already did. What it adds is asserting the write side (that the stored expiry really is now + duration), advancing time without reaching into the cache's key layout, and giving an app one clock so its goldens hold still.

// In flutter_test_config.dart, so goldens don't change by the second.
bifrostClock = () => DateTime.utc(2026, 4, 11, 9, 23, 43);

Reset it in tearDown; BifrostTestRuntime.reset already does.

Implementation

DateTime Function() bifrostClock = DateTime.now;