IterableX<T> extension

on

Properties

containsNull bool

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

Returns true if any element is null
no setter

Methods

chunked(int size) Iterable<List<T>>

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

Returns chunks of the specified size
countWhere(bool test(T element)) int

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

Counts elements that match the test
distinct() Iterable<T>

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

Returns distinct elements (removes duplicates)
distinctBy<K>(K keyOf(T element)) Iterable<T>

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

Returns distinct elements by a key selector
equalsEach(Iterable<T> other) bool

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

Checks if this iterable equals another element by element
firstWhereOrNull(bool test(T element)) → T?

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

Returns the first element matching the test, or null if none found
forEachIndexed(void action(int index, T element)) → void

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

Usage: list.forEachIndexed((index, item) => print('$index: $item'))
groupBy<K>(K keyOf(T element)) Map<K, List<T>>

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

Groups elements by a key function
lastWhereOrNull(bool test(T element)) → T?

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

Returns the last element matching the test, or null if none found
mapIndexed<R>(R transform(int index, T element)) Iterable<R>

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

Maps with index
whereNotNull() Iterable<T>

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

Returns a copy without null values (for nullable types)