wait method

Future<void> wait(
  1. Duration duration, {
  2. Shot? shot,
  3. Settle? settle,
})

Advances the clock by duration.

The verbs settle, which waits out animations; a pending timer schedules no frames, so a splash screen that navigates after three seconds needs the clock moved rather than settled. Instant either way — the clock is fake.

A wait that leaves the screen as it found it takes no automatic shot: whatever it let happen — a debounce firing, a timer the screen does not show — is not in the picture, and the step before it already is. Kept, it was that step again under another name: a consumer's helper waited Duration.zero before every screen, and 447 of the suite's 1,591 steps were those waits, each byte for byte the picture before it.

Implementation

Future<void> wait(Duration duration, {Shot? shot, Settle? settle}) => _step(
  shot,
  settle,
  () => tester.pump(duration),
  verb: 'wait',
  target: '$duration',
  autoShotNeedsChange: true,
);