ListExtension<T> extension
Extension on List
- on
-
- List<
T>
- List<
Properties
- avg → num
-
Available on List<
Calculates the average of all numeric values in the list.T> , provided by the ListExtension extensionno setter -
flatten
→ List<
T> -
Available on List<
Flattens a list of lists into a single list.T> , provided by the ListExtension extensionno setter - max → T
-
Available on List<
Returns the maximum value in the list.T> , provided by the ListExtension extensionno setter - median → num
-
Available on List<
Calculates the median value of all numeric values in the list.T> , provided by the ListExtension extensionno setter - min → T
-
Available on List<
Returns the minimum value in the list.T> , provided by the ListExtension extensionno setter - mode → num
-
Available on List<
Calculates the mode (most frequent value) of all numeric values in the list.T> , provided by the ListExtension extensionno setter - random → T
-
Available on List<
Returns a random element from the list.T> , provided by the ListExtension extensionno setter -
sortedDesc
→ List<
T> -
Available on List<
Returns a new list sorted in descending order.T> , provided by the ListExtension extensionno setter - sum → num
-
Available on List<
Calculates the sum of all numeric values in the list.T> , provided by the ListExtension extensionno setter -
whereNumbers
→ List<
num> -
Available on List<
Returns a list containing only the numeric values from the original list.T> , provided by the ListExtension extensionno setter
Methods
-
chunk(
int size) → List< List< T> > -
Available on List<
Breaks the list into multiple smaller lists of a given size.T> , provided by the ListExtension extension -
groupBy(
T fn(T)) → Map< T, List< T> > -
Available on List<
Groups the list elements according to a given condition.T> , provided by the ListExtension extension -
groupByKey(
String key) → Map< T, List< T> > -
Available on List<
Groups the list elements according to a specified key in each element.T> , provided by the ListExtension extension -
hasKey(
String key) → bool -
Available on List<
Checks if any map in the list contains the specified key.T> , provided by the ListExtension extension -
hasKeyValue(
String key, T value) → bool -
Available on List<
Checks if any map in the list contains the specified key-value pair.T> , provided by the ListExtension extension -
hasValue(
T value) → bool -
Available on List<
Checks if any map in the list contains the specified value.T> , provided by the ListExtension extension -
latest(
[String key = 'id']) → List< Map< T, T> > -
Available on List<
Returns a list of maps sorted by the given key in descending order.T> , provided by the ListExtension extension -
latestFirst(
[String key = 'id']) → Map< T, T> -
Available on List<
Returns the first item from a list of maps sorted by the given key in descending order.T> , provided by the ListExtension extension -
oldest(
[String key = 'id']) → List< Map< T, T> > -
Available on List<
Returns a list of maps sorted by the given key in ascending order.T> , provided by the ListExtension extension -
oldestFirst(
[String key = 'id']) → Map< T, T> -
Available on List<
Returns the first item from a list of maps sorted by the given key in ascending order.T> , provided by the ListExtension extension -
pluck(
String key) → List< T?> -
Available on List<
Retrieves all values for a given key from a list of maps.T> , provided by the ListExtension extension -
sortBy(
String key, {bool isDesc = false}) → List< Map< T, T> > -
Available on List<
Sorts a list of maps by the given key.T> , provided by the ListExtension extension -
sortDescBy(
String key) → List< Map< T, T> > -
Available on List<
Sorts a list of maps by the given key in descending order.T> , provided by the ListExtension extension -
sorted(
{bool isDesc = false}) → List< T> -
Available on List<
Returns a new sorted list.T> , provided by the ListExtension extension -
split(
int parts) → List< List< T> > -
Available on List<
Splits the list into a specified number of approximately equal parts.T> , provided by the ListExtension extension -
whereBetween(
String key, num start, num end) → List< T> -
Available on List<
Filters the list to include only elements where the specified key's value is within the given range.T> , provided by the ListExtension extension -
whereIn(
String key, List< T> params) → List<T> -
Available on List<
Filters the list to include only elements where the specified key's value is in the given list.T> , provided by the ListExtension extension -
whereNotBetween(
String key, num start, num end) → List< T> -
Available on List<
Filters the list to exclude elements where the specified key's value is within the given range.T> , provided by the ListExtension extension -
whereNotIn(
String key, List< T> params) → List<T> -
Available on List<
Filters the list to exclude elements where the specified key's value is in the given list.T> , provided by the ListExtension extension -
whereNotOnly(
List< String> keys) → List<T> -
Available on List<
Filters the list to exclude the specified keys for map elements.T> , provided by the ListExtension extension -
whereOnly(
List< String> keys) → List<T> -
Available on List<
Filters the list to include only the specified keys for map elements.T> , provided by the ListExtension extension