FxList class

Custom Methods on List

Constructors

FxList()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

avg(List<num> list) num
Get average of numbers
chunk(List list, int size) List
The chunk method breaks the list into multiple, smaller list of a given size
count(List list) Map?
counts the occurrences of values in the list
countBy(Iterable itr, dynamic fn(dynamic)) Map
counts the occurrences of values in the list if condition satisified
diff(List list1, List list2) List
Creates a new list with the elements of this that are not in other.
flatMap(List list) Map
Expands each element of this Iterable into zero or more elements.
flatten(List list) List
Expands each element of this Iterable into zero or more elements.
groupBy(Iterable itr, dynamic fn(dynamic)) Map<dynamic, List>
Group by objects according to key/value pair
groupByKey(List list, String key) Map
Group the objects according to key/value pair and return list
hasKey(List list, dynamic key) bool
Checks given key is exists or not
hasKeyValue(List list, String key, dynamic value) bool
Checks given key/value is exists or not
hasValue(List list, dynamic value) bool
Checks given value is exists or not
isEmptyOrNull(List? list) bool
check list is empty or null
isNotEmptyOrNull(List list) bool
check list is neither empty nor null ///check list is empty or null
max(List list) → dynamic
Get maximum number
median(List<num> list) num
Get median of numbers
min(List list) → dynamic
Get minimum number
mode(List<num> list) num
Get mode of numbers
notOnly(List list, List<String> keys) List
Removes elements from the list which is given
only(List list, List<String> keys) List
Gets only those values which is given
pluck(List list, [String? key]) List
The pluck method retrieves all of the values for a given key
random(List list) → dynamic
Returns random value from this list
sortBy(List list, String key, [bool isDesc = false]) List
The sortBy method sorts the list of objects by the given key.
sorted(List list, [bool isDesc = false]) List
Get sorted list
sum(List<num> list) num
Get sum of numbers
whereBetween(List list, String key, num start, num end) List
Filters the collection by determining if a specified item value is within a given range
whereIn(List list, String key, List<num> params) List
Removes elements from the list that do not have a specified item value
whereNotBetween(List list, String key, num start, num end) List
Filters the collection by determining if a specified item value is outside of a given range
whereNotIn(List list, String key, List<num> params) List
Removes elements from the list that have a specified item value
whereNotNull(List list, String key) List
returns items from the collection where the given key is not null
whereNull(List list, String key) List
returns items from the collection where the given key is null: