lonate library Null safety

Extensions

ArrayCliz
ArrayDifference
ArrayDrop
ArrayFlatten
ArrayFrom
ArrayIndexing
ArrayPull
ArraySorted
ArrayUnion
ArrayZip
CollectiveList
CollectiveMap
CollectiveNum
RichFunction
StringCase
StringEscape
StringMunipulator
StringPad

Properties

MAX_ARRAY_LENGTH int
read / write
timeouts Map
Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a cancel method to cancel delayed func invocations and a flush method to immediately invoke them
read / write

Functions

add(num a, num b) num
Adds two numbers.
arrayMax(List array) num
Computes the maximum value of array. If array is empty or falsey, undefined is returned.
arrayMean(List array) num
Computes the mean of the values in array.
arrayMin(List array) num
Computes the minimum value of array. If array is empty or falsey, undefined is returned.
arraySum(List array) num
Computes the sum of the values in array.
assign(dynamic object, [dynamic source]) Map
Assigns own enumerable string keyed properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.
baseFill(dynamic array, dynamic value, dynamic start, dynamic end) List
camelCase(String string) String
Converts string to camel case.
capitalize(String string) String
Converts the first character of string to upper case and the remaining to lower case.
ceil(num value, [num precision = 1]) num
Computes number rounded up to precision.
chunk(List array, dynamic size) List
Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.
clamp(num value, num lower, num upper) num
Clamps number within the inclusive lower and upper bounds.
compact(List array) List
Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.
debounce(int ms, Function target, List arguments) → void
deburr(String string) String
Deburrs string by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks.
delay(int ms, Function target, List arguments) → void
Invokes func after wait milliseconds. Any additional arguments are provided to func when it's invoked.
difference(List array, List values) List
Creates an array of array values not included in the other given arrays using SameValueZero for equality comparisons. The order and references of result values are determined by the first array.
differenceBy(List array, List values, Function iteratee) List
This method is like _.difference except that it accepts iteratee which is invoked for each element nt of array and values to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument:
divide(num a, num b) num
Divide two numbers.
drop(List array, [int n = 1]) List
dropRight(List array, [int n = 1]) List
dropWhile(List array, Function predicate) List
Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).
escape(String string) String
Converts the characters "&", "<", ">", '"', and "'" in string to their corresponding HTML entities.
escapeRegExp(String string) String
Escapes the RegExp special characters "^", "$", "", ".", "*", "+", "?", "(", ")", "", "", "{", "}", and "|" in string.
fill(List array, dynamic value, {int start = 0, int? end}) List
Fills elements of array with value from start up to, but not including, end.
findIndex(List array, Function predicate) int
This method is like _.find except that it returns the index of the first element predicate returns truthy for instead of the element itself.
findKey(Map map, Function predicate) → dynamic
it returns the key of the first element predicate returns truthy for instead of the element itself.
flatten(List array) List
Flattens array a single level deep.
flattenDeep(List array) List
flattenDepth(List array, int depth) List
Recursively flatten array up to depth times.
floor(num value, [num precision = 1]) num
Computes number rounded down to precision.
fromPairs(List pairs) Map
The inverse of _.toPairs; this method returns an object composed from key-value pairs.
get(dynamic object, dynamic path, dynamic defaultValue) → dynamic
Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
hasInObject(dynamic object, String path) bool
hasObject(dynamic object, String path) bool
Checks if path is a direct property of object.
initial(List array) List
Gets all but the last element of array.
inRange(num n, num start, [num? end]) bool
Checks if n is between start and up to, but not including, end. If end is not specified, it's set to start with start then set to 0. If start is greater than end the params are swapped to support negative ranges.
intersection(List array, List values) List
Creates an array of unique values that are included in all given arrays The order and references of result values are determined by the first array.
isEqual(dynamic a, dynamic b) bool
Performs a SameValueZero comparison between two values to determine if they are equivalent.
isGreater(dynamic value, dynamic other) bool
Checks if value is greater than other.
isGreaterEqual(dynamic value, dynamic other) bool
Checks if value is greater than or equal to other.
isLength(dynamic value) bool
isLess(dynamic value, dynamic other) bool
Checks if value is less than other.
kebabCase(String string) String
Converts string to kebab case.
lastIndexOf(List array, dynamic value, [int? fromIndex]) int
This method is like _.indexOf except that it iterates over elements of array from right to left.
lowerFirst(String string) String
Converts the first character of string to upper case and the remaining to lower case
mapsEqual(Map? a, Map? b) bool
median(List array) num
Produce the median of the given array.
memoize(Function func, [List? args]) Function
Creates a function that memoizes the result of func.
mode(List array) num
Computes the value that appears most frequently in array.
multipleComputation(Function func, [List<Function>? computors, List? args]) → dynamic
Function to compute multiple functions in parallel using the same args returns the result as one function
multiply(num a, num b) num
Multiply two numbers.
pad(String string, int length, [String? chars]) String
Pads string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.
padEnd(String string, int length, [String? chars]) String
Pads string on the right side if it's shorter than length. Padding characters are truncated if they exceed length.
padStart(String string, int length, [String? chars]) String
Pads string on the left side if it's shorter than length. Padding characters are truncated if they exceed length.
pull(List array, List values) List
Removes all given values from array
pullAt(List array, List indexes) List
Removes elements from array corresponding to indexes and returns an array of removed elements
random(num lower, num upper, [bool floating = false]) num
Produces a random number between the inclusive lower and upper bounds.
repeat(String string, int n) String
Repeats the given string n times.
replace(String string, Pattern pattern, String replacement) String
Replaces matches for pattern in string with replacement.
round(num value, [num precision = 1]) num
Computes number rounded to precision.
snakeCase(String string) String
Converts string to snake case.
sortedIndex(List array, dynamic value) int
Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.
sortedIndexOf(List array, dynamic value, [int? fromIndex]) int
This method is like _.indexOf except that it performs a binary search on a sorted array.
sortedUniq(List array) List
Returns the new duplicate free array.
sortedUniqBy(List array, Function iteratee) List
This method is like _.uniq except that it's designed and optimized for sorted arrays.
standardDeviation(List values) num
Computes the standard deviation of the values in array.
startCase(String string) String
Converts string to start case.
startsWith(String string, [dynamic target, dynamic position = 0]) bool
Checks if string starts with the given target string.
subtract(num a, num b) num
Subtract two numbers.
tail(List array) List
Gets all but the first element of array.
throttle(int ms, Function target, List arguments) Function
The function is called at most once in a specified time period the function is called with the latest arguments
truncate(String string, int length, [String? omission]) String
Truncates string if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission string which defaults to "...".
union(List array, List values) List
Returns the new array of combined values.
unionBy(List array, List values, Function iteratee) List
This method is like _.union except that it accepts iteratee which is invoked for each element of each arrays to generate the criterion by which uniqueness is computed. Result values are chosen from the first array in which the value occurs. The iteratee is invoked with one argument:
uniq(List array) List
Creates a duplicate-free version of an array, using SameValueZero 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 array.
uniqueId([dynamic prefix = '']) String
Generates a unique ID. If prefix is given, the ID is appended to it.
upperFirst([dynamic string = '']) String
Converts the first character of string to upper case.
values(dynamic object) List
Creates an array of the own enumerable string keyed property values of object.
variance(List values) num
Computes the variance of the values in array.
withOut(List array, List values) List
Creates an array excluding all given values using SameValueZero for equality comparisons.
zip(List firstArray, List secondArray, List values) List
Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.