safe_lodash library
Support for doing something awesome.
More dartdocs go here.
Functions
-
chunk<
T> (List< T> list, [int size = 1]) → List<List< T> > -
Creates an List of elements split into groups the length of
size. IfListcan't be split evenly, the final chunk will be the remaining elements. -
compact<
T> (List< T?> list) → List<T> -
Creates a list with all falsey values removed.
The values
false,null,0,"", andNaNare falsey. -
concat(
List list, [List? values]) → List -
Creates a new list concatenating
listwith any additional lists and/or values. -
difference<
T> (List< T> list, List<List< values) → List<T> >T> - Creates a list of list values not included in the other given lists.
-
differenceBy<
T, R> (List< T> list, List<List< values, R iteratee(T)) → List<T> >T> -
This method is like
differenceexcept that it acceptsiterateewhich is invoked for each element oflistandvaluesto generate the criterion by which they're compared. -
differenceWith<
T> (List< T> list, List<List< values, bool comparator(T, T)) → List<T> >T> -
This method is like
differenceexcept that it acceptscomparatorwhich is invoked to compare elements oflisttovalues. -
drop<
T> (List< T> list, [int n = 1]) → List<T> -
Creates a slice of
listwithnelements dropped from the beginning. -
dropRight<
T> (List< T> list, [int n = 1]) → List<T> -
Creates a slice of
listwithnelements dropped from the end. -
dropRightWhile<
T> (List< T> list, bool predicate(T)) → List<T> -
Creates a slice of
listexcluding elements dropped from the end. Elements are dropped untilpredicatereturns falsey. -
dropWhile<
T> (List< T> list, bool predicate(T)) → List<T> -
Creates a slice of
listexcluding elements dropped from the beginning. Elements are dropped untilpredicatereturns falsey. -
fill(
List list, dynamic value, [int start = 0, int? end]) → List -
Fills elements of
listwithvaluefromstartup to, but not including,end. -
findIndex<
T> (List< T> list, bool predicate(T), [int fromIndex = 0]) → int -
This method is like
findexcept that it returns the index of the first elementpredicatereturns truthy for instead of the element itself. -
findLastIndex<
T> (List< T> list, bool predicate(T), [int? fromIndex]) → int -
This method is like
findIndexexcept that it iterates over elements ofcollectionfrom right to left. -
first<
T> (List< T> list) → T? - Alias for head
-
flatten(
List list) → List -
Flattens
lista single level deep. -
flattenDeep(
List list) → List -
Recursively flattens
list. -
flattenDepth(
List list, [int depth = 1]) → List -
Recursively flatten
listup todepthtimes. -
fromPairs<
K, V> (List< List> pairs) → Map<K, V> -
The inverse of
toPairs; this method returns an object composed from key-valuepairs. -
head<
T> (List< T> list) → T? -
Gets the first element of
list. -
indexOf<
T> (List< T> list, T value, [int fromIndex = 0]) → int -
Gets the index at which the first occurrence of
valueis found inlist. -
initial<
T> (List< T> list) → List<T> -
Gets all but the last element of
list. -
intersection<
T> (List< List< lists) → List<T> >T> - Creates a list of unique values that are included in all given lists.
-
intersectionBy<
T, R> (List< List< lists, R iteratee(T)) → List<T> >T> -
This method is like
intersectionexcept that it acceptsiterateewhich is invoked for each element of eachliststo generate the criterion by which they're compared. -
intersectionWith<
T> (List< List< lists, bool comparator(T, T)) → List<T> >T> -
This method is like
intersectionexcept that it acceptscomparatorwhich is invoked to compare elements oflists. -
join(
List list, [String separator = ',']) → String -
Converts all elements in
listinto a string separated byseparator. -
last<
T> (List< T> list) → T? -
Gets the last element of
list. -
lastIndexOf<
T> (List< T> list, T value, [int? fromIndex]) → int -
This method is like
indexOfexcept that it iterates over elements oflistfrom right to left. -
nth<
T> (List< T> list, [int n = 0]) → T? -
Gets the element at index
noflist. Ifnis negative, the nth element from the end is returned. -
pull<
T> (List< T> list, List<T> values) → List<T> -
Removes all given values from
list. -
pullAll<
T> (List< T> list, List<T> values) → List<T> -
This method is like
pullexcept that it accepts an array of values to remove. -
pullAllBy<
T, R> (List< T> list, List<T> values, R iteratee(T)) → List<T> -
This method is like
pullAllexcept that it acceptsiterateewhich is invoked for each element oflistandvaluesto generate the criterion by which they're compared. -
pullAllWith<
T> (List< T> list, List<T> values, bool comparator(T, T)) → List<T> -
This method is like
pullAllexcept that it acceptscomparatorwhich is invoked to compare elements oflisttovalues. -
pullAt<
T> (List< T> list, List<int> indexes) → List<T> -
Removes elements from
listcorresponding toindexesand returns a list of removed elements. -
remove<
T> (List< T> list, bool predicate(T)) → List<T> -
Removes all elements from
listthatpredicatereturns truthy for and returns a list of the removed elements. -
reverse<
T> (List< T> list) → List<T> -
Reverses
listso that the first element becomes the last, the second element becomes the second to last, and so on. -
slice<
T> (List< T> list, [int start = 0, int? end]) → List<T> -
Creates a slice of
Listfromstartup to, but not including,end. -
sortedIndex<
T extends Comparable> (List< T> list, T value) → int -
Uses a binary search to determine the lowest index at which
valueshould be inserted intolistin order to maintain its sort order. -
sortedIndexBy<
T, R extends Comparable> (List< T> list, T value, R iteratee(T)) → int -
This method is like
sortedIndexexcept that it acceptsiterateewhich is invoked forvalueand each element oflistto compute their sort ranking. -
sortedIndexOf<
T> (List< T> list, T value) → int -
This method is like
indexOfexcept that it performs a binary search on a sortedlist. -
sortedLastIndex<
T extends Comparable> (List< T> list, T value) → int -
This method is like
sortedIndexexcept that it returns the highest index at whichvalueshould be inserted intolistin order to maintain its sort order. -
sortedLastIndexBy<
T, R extends Comparable> (List< T> list, T value, R iteratee(T)) → int -
This method is like
sortedLastIndexexcept that it acceptsiterateewhich is invoked forvalueand each element oflistto compute their sort ranking. -
sortedLastIndexOf<
T> (List< T> list, T value) → int -
This method is like
lastIndexOfexcept that it performs a binary search on a sortedlist. -
sortedUniq<
T> (List< T> list) → List<T> -
This method is like
uniqexcept that it's designed and optimized for sorted lists. -
sortedUniqBy<
T, R> (List< T> list, R iteratee(T)) → List<T> -
This method is like
uniqByexcept that it's designed and optimized for sorted lists. -
tail<
T> (List< T> list) → List<T> -
Gets all but the first element of
list. -
take<
T> (List< T> list, [int n = 1]) → List<T> -
Creates a slice of
listwithnelements taken from the beginning. -
takeRight<
T> (List< T> list, [int n = 1]) → List<T> -
Creates a slice of
listwithnelements taken from the end. -
takeRightWhile<
T> (List< T> list, bool predicate(T)) → List<T> -
Creates a slice of
listwith elements taken from the end. Elements are taken untilpredicatereturns falsey. -
takeWhile<
T> (List< T> list, bool predicate(T)) → List<T> -
Creates a slice of
listwith elements taken from the beginning. Elements are taken untilpredicatereturns falsey. -
toPairs(
Map map) → List< List> - Creates a list of key-value pairs from an object.
-
union<
T> (List< List< lists) → List<T> >T> - Creates a list of unique values, in order, from all given lists.
-
unionBy<
T, R> (List< List< lists, R iteratee(T)) → List<T> >T> -
This method is like
unionexcept that it acceptsiterateewhich is invoked for each element of eachliststo generate the criterion by which uniqueness is computed. -
unionWith<
T> (List< List< lists, bool comparator(T, T)) → List<T> >T> -
This method is like
unionexcept that it acceptscomparatorwhich is invoked to compare elements oflists. -
uniq<
T> (List< T> list) → List<T> -
Creates a duplicate-free version of a list, using
==for equality comparisons, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the list. -
uniqBy<
T, R> (List< T> list, R iteratee(T)) → List<T> -
This method is like
uniqexcept that it acceptsiterateewhich is invoked for each element inlistto generate the criterion by which uniqueness is computed. -
uniqWith<
T> (List< T> list, bool comparator(T, T)) → List<T> -
This method is like
uniqexcept that it acceptscomparatorwhich is invoked to compare elements oflist. -
unzip(
List< List> list) → List<List> -
This method is like
zipexcept that it accepts a list of grouped elements and creates a list regrouping the elements to their pre-zip configuration. -
unzipWith<
R> (List< List> list, R iteratee(List)) → List<R> -
This method is like
unzipexcept that it acceptsiterateeto specify how regrouped values should be combined. -
without<
T> (List< T> list, List<T> values) → List<T> - Creates a list excluding all given values.
-
xor<
T> (List< List< lists) → List<T> >T> - Creates a list of unique values that is the symmetric difference of the given lists.
-
xorBy<
T, R> (List< List< lists, R iteratee(T)) → List<T> >T> -
This method is like
xorexcept that it acceptsiterateewhich is invoked for each element of eachliststo generate the criterion by which by which they're compared. -
xorWith<
T> (List< List< lists, bool comparator(T, T)) → List<T> >T> -
This method is like
xorexcept that it acceptscomparatorwhich is invoked to compare elements oflists. -
zip(
List< List> lists) → List<List> - Creates a list of grouped elements, the first of which contains the first elements of the given lists, the second of which contains the second elements of the given lists, and so on.
-
zipObject(
List props, [List? values]) → Map -
This method is like
fromPairsexcept that it accepts two lists, one of property identifiers and one of corresponding values. -
zipWith<
R> (List< List> lists, R iteratee(List)) → List<R> -
This method is like
zipexcept that it acceptsiterateeto specify how grouped values should be combined.