IterableExtensions<E> extension

on

Properties

firstOrNull → E?
Returns the first entry if it exists otherwise null. Iterable.first
no setter
lastOrNull → E?
Returns the last entry if it exists otherwise null. Iterable.last
no setter
nullIfEmpty Iterable<E>?
returns null or if it is empty returns true.
no setter
singleOrNull → E?
Returns the single entry if it exists otherwise null. Iterable.single
no setter
tryFirst → E?
no setter
tryLast → E?
no setter
trySingle → E?
no setter

Methods

containsAll(Iterable<E> other) bool
Returns true if the specified value is equal to at least one element of the given list; false otherwise
foldWithNext<V>(V initialValue, V combiner(V previousValue, E current, E next)) → V
Reduces a collection to a single value by iteratively combining previous and current element of the collection with an existing value
generateBook({int? valuesPerPage, int? numberOfPages}) Map<int, List<E>>
generateMap<K, V>(MapEntry<K, V> generator(E)) Map<K, V>
Generate the map by collection.
groupBy<K>(K fn(E element)) Map<K, List<E>>
Splits a list into sub-lists stored in an object, based on the result of calling a function on each element, and grouping the results according to values returned.
joinBy(E generator(int index)) Iterable<E>
Concatenates the elements given by function.
joinElement(E element) Iterable<E>
Concatenates the elements.
mapWithIndex<T>(T f(E e, int i)) Iterable<T>
Returns a new lazy Iterable with elements that are created by calling f on each element and index of this Iterable in iteration order.
replaces(Map<E, E> replacements) Iterable<E>
replace the old elements contained in the map with new ones.
toMap() Map<int, E>
tryElementAt(int index) → E?
tryFirstWhere(bool test(E element)) → E?
Returns the first element that satisfies test otherwise null. Iterable.firstWhere
tryLastWhere(bool test(E element)) → E?
Returns the last element that satisfies test otherwise null. Iterable.lastWhere
trySingleWhere(bool test(E element)) → E?
Returns the single element that satisfies test otherwise null. Iterable.singleWhere
whereNotContains(Iterable<E> elements) Iterable<E>
Returns a iterable without elements
without(Iterable<E> badElements) Iterable<E>