diff --git a/CHANGELOG.md b/CHANGELOG.md index e38e1a8..7bed0e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Shuffle `IterableExtension.sample` results. - Fix `mergeSort` when the runtime iterable generic is a subtype of the static generic. +- Deprecate `whereNotNull()` from `IterableNullableExtension`. Use `nonNulls` + instead - this is an equivalent extension available in Dart core since + version 3.0. - Require Dart `^3.1.0` - Mark "mixin" classes as `mixin`. diff --git a/lib/src/iterable_extensions.dart b/lib/src/iterable_extensions.dart index 1bf4b3e..0d52fbb 100644 --- a/lib/src/iterable_extensions.dart +++ b/lib/src/iterable_extensions.dart @@ -611,6 +611,7 @@ extension IterableNullableExtension on Iterable { /// of this iterable, in their original iteration order. /// /// For an `Iterable`, this method is equivalent to `.whereType()`. + @Deprecated('Use .nonNulls instead.') Iterable whereNotNull() sync* { for (var element in this) { if (element != null) yield element;