ListExtension<T> extension

Extension on List

on

Properties

avg num

Available on List<T>, provided by the ListExtension extension

Calculates the average of all numeric values in the list.
no setter
flatten List<T>

Available on List<T>, provided by the ListExtension extension

Flattens a list of lists into a single list.
no setter
max → T

Available on List<T>, provided by the ListExtension extension

Returns the maximum value in the list.
no setter
median num

Available on List<T>, provided by the ListExtension extension

Calculates the median value of all numeric values in the list.
no setter
min → T

Available on List<T>, provided by the ListExtension extension

Returns the minimum value in the list.
no setter
mode num

Available on List<T>, provided by the ListExtension extension

Calculates the mode (most frequent value) of all numeric values in the list.
no setter
random → T

Available on List<T>, provided by the ListExtension extension

Returns a random element from the list.
no setter
sortedDesc List<T>

Available on List<T>, provided by the ListExtension extension

Returns a new list sorted in descending order.
no setter
sum num

Available on List<T>, provided by the ListExtension extension

Calculates the sum of all numeric values in the list.
no setter
whereNumbers List<num>

Available on List<T>, provided by the ListExtension extension

Returns a list containing only the numeric values from the original list.
no setter

Methods

chunk(int size) List<List<T>>

Available on List<T>, provided by the ListExtension extension

Breaks the list into multiple smaller lists of a given size.
groupBy(T fn(T)) Map<T, List<T>>

Available on List<T>, provided by the ListExtension extension

Groups the list elements according to a given condition.
groupByKey(String key) Map<T, List<T>>

Available on List<T>, provided by the ListExtension extension

Groups the list elements according to a specified key in each element.
hasKey(String key) bool

Available on List<T>, provided by the ListExtension extension

Checks if any map in the list contains the specified key.
hasKeyValue(String key, T value) bool

Available on List<T>, provided by the ListExtension extension

Checks if any map in the list contains the specified key-value pair.
hasValue(T value) bool

Available on List<T>, provided by the ListExtension extension

Checks if any map in the list contains the specified value.
latest([String key = 'id']) List<Map<T, T>>

Available on List<T>, provided by the ListExtension extension

Returns a list of maps sorted by the given key in descending order.
latestFirst([String key = 'id']) Map<T, T>

Available on List<T>, provided by the ListExtension extension

Returns the first item from a list of maps sorted by the given key in descending order.
oldest([String key = 'id']) List<Map<T, T>>

Available on List<T>, provided by the ListExtension extension

Returns a list of maps sorted by the given key in ascending order.
oldestFirst([String key = 'id']) Map<T, T>

Available on List<T>, provided by the ListExtension extension

Returns the first item from a list of maps sorted by the given key in ascending order.
pluck(String key) List<T?>

Available on List<T>, provided by the ListExtension extension

Retrieves all values for a given key from a list of maps.
sortBy(String key, {bool isDesc = false}) List<Map<T, T>>

Available on List<T>, provided by the ListExtension extension

Sorts a list of maps by the given key.
sortDescBy(String key) List<Map<T, T>>

Available on List<T>, provided by the ListExtension extension

Sorts a list of maps by the given key in descending order.
sorted({bool isDesc = false}) List<T>

Available on List<T>, provided by the ListExtension extension

Returns a new sorted list.
split(int parts) List<List<T>>

Available on List<T>, provided by the ListExtension extension

Splits the list into a specified number of approximately equal parts.
whereBetween(String key, num start, num end) List<T>

Available on List<T>, provided by the ListExtension extension

Filters the list to include only elements where the specified key's value is within the given range.
whereIn(String key, List<T> params) List<T>

Available on List<T>, provided by the ListExtension extension

Filters the list to include only elements where the specified key's value is in the given list.
whereNotBetween(String key, num start, num end) List<T>

Available on List<T>, provided by the ListExtension extension

Filters the list to exclude elements where the specified key's value is within the given range.
whereNotIn(String key, List<T> params) List<T>

Available on List<T>, provided by the ListExtension extension

Filters the list to exclude elements where the specified key's value is in the given list.
whereNotOnly(List<String> keys) List<T>

Available on List<T>, provided by the ListExtension extension

Filters the list to exclude the specified keys for map elements.
whereOnly(List<String> keys) List<T>

Available on List<T>, provided by the ListExtension extension

Filters the list to include only the specified keys for map elements.