IterableExtension<T> extension

extension for Iterable<T>.

on

Properties

asList List<T>
Returns this instance as List. Creates a copy if necessary.
no setter
asSet Set<T>
Returns this instance as Set. Creates a copy if necessary.
no setter
lastIndex int
The last index of this List.
no setter

Methods

all(bool test(T element)) bool
Checks whether ALL element of this iterable satisfies test. Returns false if isEmpty.
combinations<E>(int minimumSize, int maximumSize, {bool allowRepetition = true, bool checkAlphabet = true, Iterable<E> mapper(T e)?, bool validator(List<E> combination)?}) List<List<E>>
Generate combinations using this Iterable elements as an alphabet.
comparator({Comparator<T>? compare, T? sample}) Comparator<T>
Tries to returns a Comparator<T> for this instance. Validates compare if provided.
computeHashcode() int
Computes the hashcode of this Iterable, using IterableEquality defaults.
containsAll(Iterable<T> other) bool
Returns true if this contains all elements of other.
containsAny(Iterable<T> other) bool
Returns true if this contains at least 1 elements of other.
copy() Iterable<T>
Copies this Iterable preserving the original type if possible or returns a copy as List.
equalsElements(Iterable<T> other) bool
Returns true if all the elements are equals to other elements.
groupBy<G>(G grouper(T e)) Map<G, List<T>>
Groups elements by grouper.
printElements({dynamic printer(Object? o)?, String? prefix}) → void
Print the elements.
toMap<K, V>(K keyMapper(T e), V valueMapper(T e)) Map<K, V>
Converts this List to a Map.
toStringsList() List<String>
Returns a List
whereIn(Iterable other, {Object? view(T e)?}) Iterable<T>
Returns a new lazy Iterable with all elements contained in other.
whereNotIn(Iterable other, {Object? view(T e)?}) Iterable<T>
Returns a new lazy Iterable with all elements NOT contained in other.