Open
Description
The description of method dart:async:Stream.any() reads:
Future any(
bool test(
T element
)
)
Checks whether test accepts any element provided by this stream.Completes the Future when the answer is known.
If this stream reports an error, the Future reports that error.
Stops listening to the stream after the first matching element has been found.
Internally the method cancels its subscription after this element. This means that single-subscription (non-broadcast) streams are closed and cannot be reused after a call to this method.
Please, clarify:
- The value used to complete the returned Future instance. (Is it true if element is found and false otherwise?)
- If
test
throws error (Is the error used to complete the returned future with error? - If stream is done and no value was found. (Is the returned future completed with false?)