- Adds
shuffled
toIterableExtension
. - Shuffle
IterableExtension.sample
results. - Fix
mergeSort
when the runtime iterable generic is a subtype of the static generic. CanonicalizedMap
: added constructorfromEntries
.- Mark "mixin" classes as
mixin
. extension IterableIterableExtension<T> on Iterable<Iterable<T>>
- Add
flattenedToList
as a performance improvement overflattened.
- Add
flattenedToSet
as new behavior for flattening to unique elements.
- Add
- Deprecate
transitiveClosure
. Consider usingpackage:graphs
. - Deprecate
whereNotNull()
fromIterableNullableExtension
. UsenonNulls
instead - this is an equivalent extension available in Dart core since version 3.0. - Require Dart
^3.4.0
CanonicalizedMap
:- Added methods:
copy
: copies an instance without recalculating the canonical values of the keys.toMap
: creates aMap<K,V>
(with the original key values).toMapOfCanonicalKeys
: creates aMap<C,V>
(with the canonicalized keys).
- Added methods:
- Fixes bugs in
ListSlice.slice
andListExtensions.slice
. - Update to
package:lints
2.0.1.
- Accept Dart SDK versions above 3.0.
- Require Dart 2.18.
- Improve docs for
splitAfter
andsplitBefore
.
- Add
Iterable.elementAtOrNull
andList.elementAtOrNull
extension methods. - Add a top-level
lastBy()
function that converts anIterable
to aMap
by grouping its elements using a function, keeping the last element for each computed key. Also available as an extension method onIterable
.
- Add an
Iterable.slices
extension method. - Add
BoolList
class for space-efficient lists of boolean values. - Use a stable sort algorithm in the
IterableExtension.sortedBy
method. - Add
min
,max
,minOrNull
andmaxOrNull
getters toIterableDoubleExtension
,IterableNumberExtension
andIterableIntegerExtension
- Change
UnorderedIterableEquality
andSetEquality
to implementEquality
with a non-nullable generic to allows assignment to variables with that type. Assignment toEquality
with a nullable type is still allowed because of covariance. Theequals
andhash
methods continue to accept nullable arguments. - Enable the
avoid_dynamic_calls
lint.
- Stable release for null safety.
- Fix typo in extension method
expandIndexed
. - Update sdk constraints to
>=2.12.0-0 <3.0.0
based on beta release guidelines.
-
Allow prerelease versions of the
2.12.x
sdk. -
Remove the unusable setter
UnionSetController.set=
. This was mistakenly added to the public API but could never be called. -
Add extra optional
Random
argument toshuffle
. -
Add a large number of extension methods on
Iterable
andList
types, and on a few other types. These either provide easy access to the operations fromalgorithms.dart
, or provide convenience variants of existingIterable
andList
methods likesingleWhereOrNull
orforEachIndexed
.
- Allow 2.10 stable and 2.11.0 dev SDK versions.
- Add
toUnorderedList
method onPriorityQueue
. - Make
HeapPriorityQueue
'sremove
andcontains
methods use==
for equality checks. Previously usedcomparison(a, b) == 0
as criteria, but it's possible to have multiple elements with the same priority in a queue, so that could remove the wrong element. Still requires that objects that are==
also have the same priority.
Update for the 2.10 dev sdk.
- Allow the <=2.9.10 stable sdks.
Pre-release for the null safety migration of this package.
Note that 1.15.0
may not be the final stable null safety release version,
we reserve the right to release it as a 2.0.0
breaking change.
This release will be pinned to only allow pre-release sdk versions starting
from 2.9.0-dev.18.0
, which is the first version where this package will
appear in the null safety allow list.
- Deprecate
mapMap
. The Map interface has amap
call and map literals can use for-loop elements which supersede this method.
- Fix
CombinedMapView.keys
,CombinedMapView.length
,CombinedMapView.forEach
, andCombinedMapView.values
to work as specified and not repeat duplicate items from the maps.- As a result of this fix the
length
getter now must iterate all maps in order to remove duplicates and return an accurate length, so it is no longerO(maps)
.
- As a result of this fix the
- Set max SDK version to
<3.0.0
.
- Fix the parameter names in overridden methods to match the source.
- Make tests Dart 2 type-safe.
- Stop depending on SDK
retype
and deprecate methods.
- Fixed bugs where
QueueList
,MapKeySet
, andMapValueSet
did not adhere to the contract laid out byList.cast
,Set.cast
andMap.cast
respectively. The returned instances of these methods now correctly forward to the existing instance instead of always creating a new copy.
- Deprecated
Delegating{Name}.typed
static methods in favor of the new Dart 2cast
methods. For example,DelegatingList.typed<String>(list)
can now be written aslist.cast<String>()
.
- Only the Dart 2 dev SDK (
>=2.0.0-dev.22.0
) is now supported. - Added support for all Dart 2 SDK methods that threw
UnimplementedError
.
-
Make
DefaultEquality
'sequals()
andhash()
methods take anyObject
rather than objects of typeE
. This makesconst DefaultEquality<Null>()
usable asEquality<E>
for anyE
, which means it can be used in a const context which expectsEquality<E>
.This makes the default arguments of various other const equality constructors work in strong mode.
- Fix issue with
EmptyUnmodifiableSet
's stubs that were introduced in 1.14.4.
- Add implementation stubs of upcoming Dart 2.0 core library methods, namely
new methods for classes that implement
Iterable
,List
,Map
,Queue
, andSet
.
- Fix
MapKeySet.lookup
to be a valid override in strong mode.
- Add type arguments to
SyntheticInvocation
.
- Make
Equality
implementations acceptnull
as argument tohash
.
- Add
CombinedListView
, a view of several lists concatenated together. - Add
CombinedIterableView
, a view of several iterables concatenated together. - Add
CombinedMapView
, a view of several maps concatenated together.
- Add
EqualityBy
-
Add
CaseInsensitiveEquality
. -
Fix bug in
equalsIgnoreAsciiCase
.
- Add
EqualityMap
andEqualitySet
classes which useEquality
objects for key and element equality, respectively.
Set.difference
now takes aSet<Object>
as argument.
- Fix some documentation bugs.
- Add a top-level
stronglyConnectedComponents()
function that returns the strongly connected components in a directed graph.
-
Add a top-level
mapMap()
function that works likeIterable.map()
on aMap
. -
Add a top-level
mergeMaps()
function that creates a new map with the combined contents of two existing maps. -
Add a top-level
groupBy()
function that converts anIterable
to aMap
by grouping its elements using a function. -
Add top-level
minBy()
andmaxBy()
functions that return the minimum and maximum values in anIterable
, respectively, ordered by a derived value. -
Add a top-level
transitiveClosure()
function that returns the transitive closure of a directed graph.
- Add a
const UnmodifiableSetView.empty()
constructor.
-
Add a
UnionSet
class that provides a view of the union of a set of sets. -
Add a
UnionSetController
class that provides a convenient way to manage the contents of aUnionSet
. -
Fix another incorrectly-declared generic type.
- Fix an incorrectly-declared generic type.
-
Add
DelegatingIterable.typed()
,DelegatingList.typed()
,DelegatingSet.typed()
,DelegatingMap.typed()
, andDelegatingQueue.typed()
static methods. These wrap untyped instances of these classes with the correct type parameter, and assert the types of values as they're accessed. -
Fix the types for
binarySearch()
andlowerBound()
so they no longer require all arguments to be comparable. -
Add generic annotations to
insertionSort()
andmergeSort()
.
- Fix all strong mode warnings.
-
Add a
new PriorityQueue()
constructor that forwards tonew HeapPriorityQueue()
. -
Deprecate top-level libraries other than
package:collection/collection.dart
, which exports these libraries' interfaces.
-
Add
lowerBound
to binary search for values that might not be present. -
Verify that the is valid for
CanonicalMap.[]
.
- Add string comparators that ignore ASCII case and sort numbers numerically.
- Fix type inconsistencies with
Map
andSet
.
- Export
UnmodifiableMapView
from the Dart core libraries.
- Bug-fix for signatures of
isValidKey
arguments ofCanonicalizedMap
.
- Add a
QueueList
class that implements bothQueue
andList
.
- Add a
CanonicalizedMap
class that canonicalizes its keys to provide a custom equality relation.
- Fix all analyzer hints.
-
Add a
MapKeySet
class that exposes an unmodifiableSet
view of aMap
's keys. -
Add a
MapValueSet
class that takes a function from values to keys and uses it to expose aSet
view of aMap
's values.