-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream/Iterable.firstWhere inconsistency (orElse vs. defaultValue) #22028
Comments
That's an annoying difference. Thanks for noticing! Same problem for Added this to the 2.0 milestone. |
This comment was originally written by @seaneagan A related annoyance: Not being able to call |
This comment was originally written by @seaneagan For example, here's what I would want for Stream.firstWhere: firstWhere(Stream stream, bool test(item), { orElse() }) async { |
This comment was originally written by @seaneagan Correction: Future<T> firstWhere(test(item), { orElse() }) async { |
Are any further changes planned here for 2.0 @lrhn? |
This has almost been fixed, but we still need to remove the |
Any updates here? We are 2 days out from the Dart2 Beta 3 milestone. |
The |
This issue was originally filed by @seaneagan
I wanted to call
firstWhere
on a variable which could either be an Iterable or a Stream , but since I needed to have a fallback, I needed orElse / defaultValue, but since they are named differently I would have to test if the variable is an Iterable or or Stream first.The text was updated successfully, but these errors were encountered: