[sdk] Updating Stream.contains to accept null values.

Change-Id: Icdb4e3fb04625b8e0ffabe1214b196cd7a9eb1ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138888
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
This commit is contained in:
Mark Zhou 2020-03-10 15:58:26 +00:00 committed by commit-bot@chromium.org
parent 7e0139e0c0
commit 44a4f366e2

View file

@ -837,7 +837,7 @@ abstract class Stream<T> {
* the returned future is completed with that error,
* and processing stops.
*/
Future<bool> contains(Object needle) {
Future<bool> contains(Object? needle) {
_Future<bool> future = new _Future<bool>();
StreamSubscription<T> subscription =
this.listen(null, onError: future._completeError, onDone: () {