From d7c0cd5a458308ab5e5a0d0deebdce32c4391ec6 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() (#278) Exists in SDK as of v3.0 --- lib/src/cancelable_operation.dart | 4 +--- lib/src/stream_group.dart | 4 +--- lib/src/stream_queue.dart | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/src/cancelable_operation.dart b/lib/src/cancelable_operation.dart index bb59f60..2610613 100644 --- a/lib/src/cancelable_operation.dart +++ b/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/lib/src/stream_group.dart b/lib/src/stream_group.dart index 78912c9..502a111 100644 --- a/lib/src/stream_group.dart +++ b/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/lib/src/stream_queue.dart b/lib/src/stream_queue.dart index f7ab8ba..c5c0c19 100644 --- a/lib/src/stream_queue.dart +++ b/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';