IterablesExtension<T> extension
Adds extensions to the List
class
- on
-
- Iterable<
T>
- Iterable<
Properties
-
frequencies
→ Map<
T, int> -
Available on Iterable<
Returns a map that represents the frequency of each element in the list.T> , provided by the IterablesExtension extensionno setter - leastFrequent → T?
-
Available on Iterable<
Returns the least frequent element in the list.T> , provided by the IterablesExtension extensionno setter - mostFrequent → T?
-
Available on Iterable<
Returns the most frequent element in the list.T> , provided by the IterablesExtension extensionno setter -
orderByRandom
→ Iterable<
T> -
Available on Iterable<
T> , provided by the IterablesExtension extensionno setter - randomItem → T?
-
Available on Iterable<
Returns a random item from the list.T> , provided by the IterablesExtension extensionno setter -
whereNotBlank
→ Iterable<
T> -
Available on Iterable<
T> , provided by the IterablesExtension extensionno setter -
whereValid
→ Iterable<
T> -
Available on Iterable<
return only valid items (seeT> , provided by the IterablesExtension extensionObject.isValid
)no setter
Methods
-
containsAll(
Iterable< T> otherList) → bool -
Available on Iterable<
Checks if this list contains all elements fromT> , provided by the IterablesExtension extensionotherList
. -
containsAny(
Iterable< T> otherList) → bool -
Available on Iterable<
T> , provided by the IterablesExtension extension -
containsAtLeast(
int count, List< T> values) → bool -
Available on Iterable<
Checks if a list contains at leastT> , provided by the IterablesExtension extensioncount
values fromvalues
. -
distinctBy<
E> (E predicate(T)) → Set< T> -
Available on Iterable<
Removes duplicate elements from a list based on a provided predicate.T> , provided by the IterablesExtension extension -
distinctByComparison(
bool comparison(T, T)) → Set< T> -
Available on Iterable<
Removes duplicate elements from a list based on a provided comparison function.T> , provided by the IterablesExtension extension -
groupAndMapBy<
M> (M keyFunction(T)) → Map< M, List< T> > -
Available on Iterable<
Groups the items in the list by the item returned by the lambda function.T> , provided by the IterablesExtension extension -
groupAndRemapBy<
M, V> (M keyFunction(T), V valueFunction(List< T> )) → Map<M, V> -
Available on Iterable<
Groups the items in the list by the item returned by the lambda function and remaps the values.T> , provided by the IterablesExtension extension -
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<
Group the itens of a listT> , provided by the IterablesExtension extension -
keySearch(
{required KeyCharSearches< T> keyCharSearches, required dynamic searchTerms, int maxResults = 0}) → Iterable<T> -
Available on Iterable<
Searches for items in this iterable based on the givenT> , provided by the IterablesExtension extensionsearchTerms
. -
pairUp(
List< T> other) → List<(T?, T?)> -
Available on Iterable<
Pairs up the elements of this list with the elements of theT> , provided by the IterablesExtension extensionother
list. Returns a new list of tuples, where each tuple contains two elements: the corresponding element from this list and the corresponding element from theother
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<
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 providedT> , provided by the IterablesExtension extensionother
list. If an element in the original list is not found in theother
list, its index will be represented as -1 in the pair. -
search(
{required dynamic searchTerms, SearchOnFunction< T> ? searchOn, int levenshteinDistance = 0, bool ignoreCase = true, bool ignoreDiacritics = true, bool ignoreWordSplitters = true, bool splitCamelCase = true, bool useWildcards = false, bool allIfEmpty = true, int minChars = 0, int maxResults = 0}) → Iterable<T> -
Available on Iterable<
T> , provided by the IterablesExtension extension -
split(
int count) → List< List< T> > -
Available on Iterable<
Splits the list into multiple sublists of the specifiedT> , provided by the IterablesExtension extensioncount
. -
splitBy(
int keyFunction(T)) → List< List< T> > -
Available on Iterable<
Splits the list into sublists based on the providedT> , provided by the IterablesExtension extensionkeyFunction
. 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<
Splits the list into sublists based on a given predicate.T> , provided by the IterablesExtension extension