IterableExtensions<T> extension

Selection of Iterable Extensions frequently used at NonVanilla.

on

Methods

mapGrouped<K, G>({required K? groupBy(T item), required G groupBuilder(K? key, List<T> items)}) Iterable<G>
Group elements with the groupBy Function and map those groups with the groupBuilder.
mapIndexed<R>(R f(int index, T element)) Iterable<R>
Behaves like the map function but also exposes the index of the current element.
mapN<R>(R f(List<T> element), {required int n}) Iterable<R>
Behaves like the map function but iterates over n elements at a time.
separatedBy(T separator) Iterable<T>
Inserts a Type T in between every two elements in an iterable.