NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #2402 most downloaded on pub.dev
The power of lazy-evaluated enumerables in your hands! (A port of functional LINQ from the .NET library.)
Last release 1 years ago
25 Aug 2025
Release timing varies
gaps range from 2 weeks to 2.3 years
Nearly every release is documented
notes for 19 of 19 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
22 releases · first in 2019
Added the following new extension methods:
insertEvery:
insertWhere:
insertOrAppendWhere:
insertWhere, but if no satisfying element is found, appends the value at the end.interleaveValue:
interleaveValueWhere:
random
replaceAll
RepeatIterator(value, iterable.count()).)replaceAt
replaceEvery
replaceRange
replaceRangeValue
replaceWhere
splitSequence
splitWhere
keepSeparator parameter to split to optionally keep the element that was specified as the separator in the resulting iterable.
splitSequence and splitWhere methods also have this parameter.delay parameter to toStream to optionally delay the speed at which the elements are fed to the stream.average that caused integer lists to sometimes not return accurate averages.ArgumentError when a RangeError would be more idiomatic.StateError when an UnsupportedError would be more idiomatic.excludeAt. (#17)EqualityComparer for bool for the sake of convenience and completeness. (#18)hashCode implementation in Tuples in favor of a Object.hashAll approach.lint package instead of the lints package.One column per quarter.
Potentially Breaking: Updated class definitions to be compliant with the new "strict-casts" and "strict-raw-types" analysis rules.
Iterator instead of implementing it due to Iterator now being abstract mixin.deconstruct extension method for converting an iterable of records into a record of iterables. (This method is implemented specifically on iterables of records, up to records containing 9 fields.)
fromRecord factory method to all Tuple classes, allowing them to be generated from records with the same number of fields.toRecord method to all Tuple classes, allowing them to be converted into records.Map that adds the following members:
entryRecords getter: Same as entries but returns Iterable<({TKey key, TValue value})> (an iterable of named records) instead of Iterable<MapEntry>.entryTuples getter: Same as entries but returns Iterable<Tuple2> instead of Iterable<MapEntry>.Reimplemented Grouping.hashCode to take elements into account.
Grouping.hashCode to take elements into account.Grouping.== to adhere to Dart best practices when overriding hashCode.…be impractical if not impossible without major breaking changes.
firstOrDefault, firstWhereOrDefault, lastOrDefault, and lastWhereOrDefault changed from T to T? to match behavior with corresponding functions in LINQ. (#14)Iterable from list of known equality comparers as type matching for any arbitrary Iterable<T> has turned out to be impractical if not impossible without major breaking changes.DateTime to list of known equality comparers. (#10)EqualityComparer.of for creating default comparers of types that implement Comparable. (#10)sum to return 0 on an empty iterable to be consistent with C#'s Enumerable.Sum method. (#12)Lookup from properly grouping objects when the number of groups was greater than 7. (#13)Previous change to distinct, except, intersect, and union altered. Return type of dynamic for keySelector is now Object to prevent a dynamic return ty
distinct, except, intersect, and union altered. Return type of dynamic for keySelector is now Object to prevent a dynamic return type of void. (@rodion-m)As a result, some elements have received breaking changes to their type signatures.
randomize (@rodion-m)randomize and randomSubset have been moved to dedicated iterator classes so that the resulting iterables aren't inherently memoized. (Memoization can still be done explicitly by calling memoize on the resulting iterable.)reverse has been moved to a dedicated iterator class so that its generation is deferred until iteration.distinct, except, intersect, and union no longer take a generic type parameter. The keySelector passed to these methods now returns dynamic instead of TKey.aggregateRight and tryAggregateRight no longer take a generic type parameter.sequenceEquals no longer takes generic type parameters or selector methods. The previous behavior has been moved to a new method: sequenceEqualsSelect.Fixed a bug with Tuple.fromMap that would've made it fail with Tuple1 map representation.
Tuple.fromMap that would've made it fail with Tuple1 map representation.asType and asDynamic methods to tuple classes for convenient casting of tuples.Updating references to the repository following transfer.
Fully documented the tuple classes so they can actually be used.
Tuple abstract class, which also contains generalized factory methods for creating tuples of a dynamic length.copyWithout method to tuple classes as a utility operation for trimming values from existing tuple objects.length in tuple classes to return a constant value.Corrected some parts of the README tuple section
Quality of life changes to the Tuple family classes:
Tuple family classes:
fromList factory constructors to all Tuple classes.const.mapActions to all Tuple classes.Accidentally uploaded the previous version without updating the documentation first. Oops.
The default named parameter of methods which take a default value are now marked as required (but can still be explicitly set to null if the generic t
default named parameter of methods which take a default value are now marked as required (but can still be explicitly set to null if the generic type argument of the iterable is a nullable type). This affects the following methods: elementAtOrDefault, firstOrDefault, firstWhereOrDefault, lagSelect, lag, lastOrDefault, lastWhereOrDefault, leadSelect, lead, padEnd, padStartfillBackward, fillForward, and fillMissing extensions have been reconfigured to only target iterables of nullable typesEqualityComparer.forType has been refactored to return a default EqualityComparer when a patching comparer for the requested type was not found. The previous behavior has been converted into the new EqualityComaprer.tryForType method which instead returns null when a match is not found.
EqualityComparer has a comparer of (a, b) => a == b, a hasher of (a) => a.hashCode, and a sorter of (a, b) => 0checkNullError and argument null checks as they are now redundantaggregateRight and tryAggregateRight that led to incorrect results in cases where the aggregation depended on concatenation (e.g. strings)Added identifiers to parameters for all function types to aid with IntelliSense (Issue #4)
toList on MemoizedIterable to return the cached list if the cache had already been filledsum, average converted to use generic type arguments instead of num. (@rodion-m)Grouping<dynamic, dynamic> (Issue #3, @Miiite)Enumerable and all related subclasses have been removed. The package has changed over to using static extension methods on Iterable.
Enumerable and all related subclasses have been removed. The package has changed over to using static extension methods on Iterable.
E have been removed.Enumerable factory constructors have been converted into standalone factory classes (if not made redundant by existing Iterable constructors).
Enumerable.empty -> Iterable.emptyEnumerable.from -> redundantEnumerable.generate -> Iterable.generateEnumerable.repeat -> RepeatIteratorRangeIterator
Iterable methods of the same name.
join -> joinMapIterable methods.
select: Selector argument now requires (T element, int index) as the parameters.selectMany: Selector argument now requires (T element, int index) as the parameters.Iterable make them fully redundant.
castelementAtfirstlastsingletaketakeWhileskipskipWhiletoListtoSetwheresegment
String to facilitate easy conversion to Iterable<String>.
iterable: Returns an iterable of the characters in the string.iterableRunes: Returns an iterable of the characters in the string while respecting rune boundaries.Fixing a bug in the documentation
Typedefs have been converted from a shorthand form to the full form. This should help with some type inference issues.
Unit tests have been added to ensure Iterable built-in functions behave as expected.
Iterable built-in functions behave as expected.aggregatorE, sumE, and orderByE) have been extended to also support Duration and BigInt.UnexpectedStateError, KeyExistsError, and IntegerOverflowError now extend StateError instead of Error.ConversionError now extends CastError instead of Error.IncompatibleTypeError now extends UnsupportedError instead of Error.NullEnumerableError, EmptyEnumerableError, and ElementNotFoundError have been merged into EnumerableError which extends StateError.OperationError has been removed. Code that threw OperationError now throws StateError with a descriptive message.ValueEnumerable for specialized behavior when the source Iterable supports various actions. (Currently the only specialized subtype is ListIterator which enables short-circuiting for countE and elementAtE methods to call the list's length property and indexer, respectively.)countE to call the underlying iterable's length property when condition is not specified. This should enable O(1) length calculations for default Dart collections that internally implement EfficientLengthIterable.EqualityComparer to enable global setting of default comparers of new types. For example, for a custom type Foo, the static method EqualityComparer.addDefaultEqualityComparer<Foo>(comparer) will set the global default comparer for Foo to the passed comparer values. Following this call, all calls to LINQ methods that take an optional EqualityComparer<Foo> will default to using the previously registered comparer when a comparer is not specified.Known Issues:
joinE and groupJoinE have a problem with the type inference of the parameters, causing the types to default to dynamic. When calling these methods while specifying an EqualityComparer, it may be necessary to explicitly state the type parameters as well as the types of parameters in any closure functions to get type inference to work properly.The naming convention of the enumerable methods has been changed so that they are suffixed by the letter "e" (such as selectE, joinE, whereE). This is
selectE, joinE, whereE). This is an attempt at a compromise between keeping the names of the methods consistent with their .NET origins while avoiding conflicts with existing Iterable methods.Enumerable: fromString and generator. fromString converts a String into an Enumerable that iterates over each individual character, while generator allows an iterable to be created of the specified length using a given generator function.countIfE has been merged with countE so that countE now has a Condition as an optional parameter. If the Condition is provided, the behavior is identical to countIfE, and if not, the behavior is identical to the original countE.Addressing pub description warnings.
Addressing pub formatting warnings and issues.
* Initial release.
Your coding agent can read these notes before it upgrades. Set up the MCP server →