UtilityList<T> extension
Properties
-
isGrowable
→ bool
-
returns
true
if it is Growable list
otherwise false.
no setter
Methods
-
addAllWhile(List<T> from, bool test(T element))
→ List<T?>?
-
starts
adding elements
to this
from from
until condition becomes false
-
addIf(List<T> from, bool test(T element))
→ List<T?>?
-
adds
elements
which satisfies test
from List<T> from
to this
.
-
chunk([int size = 1])
→ List<List<T?>?>
-
Creates a new list of elements split into groups the length of
size
.
-
compact()
→ List<T?>?
-
Creates an list of elements where the values of the list are not
Falsey
.
-
drop([int n = 1])
→ List<T?>
-
removes
n
number of elements from the beginning of list
-
dropRight([int n = 1])
→ List<T?>
-
removes
n
number of elements from the ending of list
-
dropRightWhile(bool test(T? element))
→ List<T?>
-
starts
removing elements
from the ending of list
until condition becomes false
-
dropWhile(bool test(T? element))
→ List<T?>
-
starts
removing elements
from the starting of list
until condition becomes false
-
flatten()
→ List<T?>
-
Flattens
array a single level deep.
-
flattenDeep()
→ List<T?>
-
Recursively flattens array.
-
flattenDepth([int depth = 1])
→ List<T?>
-
Recursively flatten array up to depth times.
-
random({bool secure = false, bool remove = false, int? seed})
→ T?
-
Returns
random value
from list. If list is empty then it returns null
-
removeFirst()
→ T?
-
Removes items at
0
position in this
-
slice(int start, [int? end])
→ List<T?>
-
Creates a slice of
list
from start
up to end
exclusive
.