Settle.elapse constructor
- Duration budget
Spend all of budget on the fake clock, whatever the frame loop is
doing — the policy for work that waits on a timer rather than on frames.
Where Settle.upTo asks the app whether to keep going, this one does not
ask: it advances the clock, so a timer due inside budget fires and
whatever it wakes gets its frames. Pumping past a quiet screen is close to
free — a pump with nothing due builds nothing — so the cost is not the
frames.
The cost is that the clock really does move. A snackbar that
auto-dismisses at four seconds is gone by the end of a five-second
budget, and a screen captured after this policy is the screen as it stands
at budget, not as it stood when it stopped changing. That is why it is
not the default: reach for it where the question is does this work at
all rather than what does it look like now.
Implementation
const factory Settle.elapse(Duration budget) = _Elapsed;