ListUtilities<T> extension
/// Extends List with additional basic methods.
- on
-
- List<
T>
- List<
Methods
-
count(
T object) → int -
Available on List<
Returns the number of instances there are ofT> , provided by the ListUtilities extensionobject
in this list. -
exclude(
Iterable< T> subset) → List<T> -
Available on List<
Returns a new list containing all of the elements in this list that aren't also contained withinT> , provided by the ListUtilities extensionsubset
. -
excludeByIndex(
Iterable< int> indexes) → List<T> -
Available on List<
Returns a sublist containing every element in this list, excluding those at the definedT> , provided by the ListUtilities extensionindexes
. -
getRandom(
int count, [int? seed]) → List< T> -
Available on List<
Returns a new list containing random elements from this list.T> , provided by the ListUtilities extension -
pluck(
int start, int? end) → List< T> -
Available on List<
Removes and returns a range of elements from this list.T> , provided by the ListUtilities extension -
removeFirst(
) → T -
Available on List<
Removes the first element in this list.T> , provided by the ListUtilities extension -
removeFirstWhere(
ListTester< T> test) → bool -
Available on List<
Removes the first element in this list that satisfiesT> , provided by the ListUtilities extensiontest
. -
removeFrom(
int index, int count) → void -
Available on List<
Removes the number of elements defined byT> , provided by the ListUtilities extensioncount
, starting fromindex
. -
removeFromEnd(
int count) → void -
Available on List<
Removes the number of elements defined byT> , provided by the ListUtilities extensioncount
from the end of the list. -
removeLastWhere(
ListTester< T> test) → bool -
Available on List<
Removes the last element in this list that satisfiesT> , provided by the ListUtilities extensiontest
. -
removeNull(
) → void -
Available on List<
Removes allT> , provided by the ListUtilities extensionnull
values from this list. -
removeRandom(
[int? seed]) → T -
Available on List<
Removes and returns a random value from this list.T> , provided by the ListUtilities extension -
resizeAndFill(
int resizeBy, T fill) → void -
Available on List<
Resizes the list byT> , provided by the ListUtilities extensionresizeBy
, setting the new elements tofill
ifresizeBy
is positive, otherwise removing elements ifresizeBy
is negative. -
resizeAndGenerate(
int resizeBy, ListGenerator< T> generator) → void -
Available on List<
Resizes the list byT> , provided by the ListUtilities extensionresizeBy
, setting the new elements with thegenerator
ifresizeBy
is positive, otherwise removing elements ifresizeBy
is negative. -
transform(
int index, ListTransformer< T> transformer) → void -
Available on List<
Updates the element atT> , provided by the ListUtilities extensionindex
to the value returned bytransformer
. -
transformAll(
ListTransformer< T> transformer) → void -
Available on List<
Updates every element in the list to the value returned byT> , provided by the ListUtilities extensiontransformer
.