From 9383a3c0ac250c796a5c37272aab72ee20025276 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 17 Jun 2024 11:15:11 -0700 Subject: [PATCH] Drop use of pkg:collection whereNotNull() (dart-lang/async#278) Exists in SDK as of v3.0 --- pkgs/async/lib/src/cancelable_operation.dart | 4 +--- pkgs/async/lib/src/stream_group.dart | 4 +--- pkgs/async/lib/src/stream_queue.dart | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/async/lib/src/cancelable_operation.dart b/pkgs/async/lib/src/cancelable_operation.dart index bb59f60e..2610613c 100644 --- a/pkgs/async/lib/src/cancelable_operation.dart +++ b/pkgs/async/lib/src/cancelable_operation.dart @@ -4,8 +4,6 @@ import 'dart:async'; -import 'package:collection/collection.dart'; - /// An asynchronous operation that can be cancelled. /// /// The value of this operation is exposed as [value]. When this operation is @@ -521,7 +519,7 @@ class CancelableCompleter { final isFuture = toReturn is Future; final cancelFutures = >[ if (isFuture) toReturn, - ...?_cancelForwarders?.map(_forward).whereNotNull() + ...?_cancelForwarders?.map(_forward).nonNulls ]; final results = (isFuture && cancelFutures.length == 1) ? [await toReturn] diff --git a/pkgs/async/lib/src/stream_group.dart b/pkgs/async/lib/src/stream_group.dart index 78912c9f..502a111c 100644 --- a/pkgs/async/lib/src/stream_group.dart +++ b/pkgs/async/lib/src/stream_group.dart @@ -4,8 +4,6 @@ import 'dart:async'; -import 'package:collection/collection.dart'; - /// A collection of streams whose events are unified and sent through a central /// stream. /// @@ -239,7 +237,7 @@ class StreamGroup implements Sink> { return null; } }) - .whereNotNull() + .nonNulls .toList(); _subscriptions.clear(); diff --git a/pkgs/async/lib/src/stream_queue.dart b/pkgs/async/lib/src/stream_queue.dart index f7ab8bad..c5c0c196 100644 --- a/pkgs/async/lib/src/stream_queue.dart +++ b/pkgs/async/lib/src/stream_queue.dart @@ -5,7 +5,7 @@ import 'dart:async'; import 'dart:collection'; -import 'package:collection/collection.dart'; +import 'package:collection/collection.dart' show QueueList; import 'cancelable_operation.dart'; import 'result/result.dart';