IterablesExtension<T> extension

Adds extensions to the List class

on

Properties

frequencies Map<T, int>

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

Returns a map that represents the frequency of each element in the list.
no setter
leastFrequent → T?

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

Returns the least frequent element in the list.
no setter
mostFrequent → T?

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

Returns the most frequent element in the list.
no setter
orderByRandom Iterable<T>

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

no setter
randomItem → T?

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

Returns a random item from the list.
no setter
whereNotBlank Iterable<T>

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

no setter
whereValid Iterable<T>

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

return only valid items (see Object.isValid)
no setter

Methods

containsAll(Iterable<T> otherList) bool

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

Checks if this list contains all elements from otherList.
containsAny(Iterable<T> otherList) bool

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

containsAtLeast(int count, List<T> values) bool

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

Checks if a list contains at least count values from values.
distinctBy<E>(E predicate(T)) Set<T>

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

Removes duplicate elements from a list based on a provided predicate.
distinctByComparison(bool comparison(T, T)) Set<T>

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

Removes duplicate elements from a list based on a provided comparison function.
groupAndMapBy<M>(M keyFunction(T)) Map<M, List<T>>

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

Groups the items in the list by the item returned by the lambda function.
groupAndRemapBy<M, V>(M keyFunction(T), V valueFunction(List<T>)) Map<M, V>

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

Groups the items in the list by the item returned by the lambda function and remaps the values.
groupAndRemapValuesBy<M, V>(M keyFunction(T), V onValueFunction(T)) Map<M, List<V>>

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

groupInPage(int pageSize) List<List<T>>

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

Group the itens of a list
keySearch({required KeyCharSearches<T> keyCharSearches, required dynamic searchTerms, int maxResults = 0}) Iterable<T>

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

Searches for items in this iterable based on the given searchTerms.
pairUp(List<T> other) List<(T?, T?)>

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

Pairs up the elements of this list with the elements of the other list. Returns a new list of tuples, where each tuple contains two elements: the corresponding element from this list and the corresponding element from the other list. If one of the lists is shorter than the other, the missing elements are paired with null.
pairUpIndexes(List<T> other) List<(int, int)>

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

Returns a list of pairs of indexes, where each pair represents the index of an element in the original list and the index of the same element in the provided other list. If an element in the original list is not found in the other list, its index will be represented as -1 in the pair.

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

split(int count) List<List<T>>

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

Splits the list into multiple sublists of the specified count.
splitBy(int keyFunction(T)) List<List<T>>

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

Splits the list into sublists based on the provided keyFunction. Each sublist contains elements that have the same key value. Returns a list of sublists.
splitByPredicate(bool predicate(T, T)) List<List<T>>

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

Splits the list into sublists based on a given predicate.