until method
Waits until the value satisfies a condition.
Returns an Until that implements Future and can be awaited. The returned value also has a Until.cancel method to stop waiting and dispose the effect when the predicate will never be satisfied.
Parameters:
predicate: Function that returnstruewhen condition is metdetach: If true, the effect will not be bound to the current scope
Returns: An Until that completes with the value when condition is satisfied
Example:
final count = Signal(0);
final until = count.until((value) => value >= 5);
// await until; // wait for condition
// until.cancel(); // or cancel to stop waiting
Implementation
Until<T> until(bool Function(T value) predicate, {bool? detach}) =>
Until<T>(this, predicate, detach: detach);