ExtensionIterableT<T> extension

on

Properties

firstOrNull → T?

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the first element. If there is no first element it will return null.
no setter
lastIndex int?

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the last accessible index. If collection is empty this returns null.
no setter
lastOrNull → T?

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the last element. If there is no last element it will return null.
no setter
withoutFirst Iterable<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Lazily returns all values without the first one.
no setter
withoutLast Iterable<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Lazily returns all values without the last one.
no setter

Methods

associate<K, V>(MapEntry<K, V> transform(T element)) Map<K, V>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns a map that contains MapEntrys provided by a transform function.
associateBy<K>(K keySelector(T element)) Map<K, T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns a map where every element is associated by a key produced from the keySelector function.
associateWith<V>(V valueSelector(T element)) Map<T, V>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns a map where every element is used as a key that is associated with a value produced by the valueSelector function.
averageBy(num selector(T)) double?

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the average value (arithmetic mean) of all values produces by the selector function that is applied to each element.
chunked(int size, {T fill()?}) Iterable<List<T>>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Splits the elements into lists of the specified size.
count([bool test(T element)?]) int

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the number of elements that matches the test.
elementAtOrElse(int index, T orElse()) → T

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the indexth element. If the index is out of bounds the orElse supplier function is called to provide a value.
elementAtOrNull(int index) → T

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the indexth element. If the index is out of bounds it will return null.
filter(bool test(T element)) Iterable<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns a new Iterable with all elements that satisfy the predicate test.
firstOrElse(T orElse()) → T

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the first element. If there is no first element the orElse supplier function is called to provide a value.
forEachIndexed(void funcIndexValue(int index, T element)) → void

Available on Iterable<T>, provided by the ExtensionIterableT extension

Applies the function funcIndexValue to each element of this collection in iteration order. The function receives the element index as first parameter index and the element as the second parameter.
groupBy<K, V>(K keySelector(T element), {V valueTransform(T element)?}) Map<K, List<V>>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Groups the elements of the list into a map by a key that is defined by a keySelector function.
insertElementBetween(T element) List<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

insert Element Between Example:
lastOrElse(T orElse()) → T

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the last element. If there is no last element the orElse supplier function is called to provide a value.
mapIndexed<U>(U transformer(T currentValue, int index)) Iterable<U>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Just like map, but with access to the element's current index.
maximumBy(Comparator<T> comparator) → T?

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the maximum value based on the comparator function.
minimumBy(Comparator<T> comparator) → T?

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the minimal value based on the comparator function.
onEach(void action(T element)) Iterable<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Applies the given action on each element and also returns the whole Iterable without modifying it.
onEachIndexed(void action(T element, int index)) Iterable<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Applies the given action on each element and also returns the whole Iterable without modifying it. The action takes a second parameter index matching the element index.
pickOne([Random? random]) → T

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns a random item. The randomness can be customized by setting random.
pickSome(int count, [Random? random]) List<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns an List of count random items. The randomness can be customized by setting random.
replaceFirstWhere(bool comparator(T currentValue), T newValue) Iterable<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Replaces the first element that matches the comparator with newValue.
replaceWhere(bool comparator(T currentValue), T newValue) Iterable<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Replaces every element that matches the comparator with newValue.
sortedBy(Comparator<T> comparator) List<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns this as sorted list using the comparator function.
sortedByNum(num valueProvider(T element)) List<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns this as sorted list using the valueProvider function that produces numerical values as base for sorting.
sortedByString(String valueProvider(T element)) List<T>

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns this as sorted list using the valueProvider function that produces character values as base for sorting.
sumBy(int selector(T)) int

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the sum of all values produced by the selector function that is applied to each element.
sumByDouble(num selector(T)) double

Available on Iterable<T>, provided by the ExtensionIterableT extension

Returns the sum of all values produced by the selector function that is applied to each element.