ListBasics<E> extension
Utility extension methods for the native List class.
- on
-
- List<
E>
- List<
Methods
-
slice(
{int? start, int? end, int step = 1}) → List< E> -
Returns a new list containing the elements of
this
fromstart
inclusive toend
exclusive, skipping bystep
. -
sortBy(
Comparable sortKey(E)) → void -
Sorts this list by the value returned by
sortKey
for each element. -
sortedCopy(
) → List< E> - Returns a sorted copy of this list.
-
sortedCopyBy(
Comparable sortKey(E)) → List< E> -
Returns a copy of this list sorted by the value returned by
sortKey
for each element. -
takeRandom(
{int? seed}) → E? -
Removes a random element of
this
and returns it.