ListBasics<E> extension

Utility extension methods for the native List class.

on

Methods

slice({int? start, int? end, int step = 1}) List<E>

Available on List<E>, provided by the ListBasics extension

Returns a new list containing the elements of this from start inclusive to end exclusive, skipping by step.
sortBy(Comparable sortKey(E)) → void

Available on List<E>, provided by the ListBasics extension

Sorts this list by the value returned by sortKey for each element.
sortedCopy() List<E>

Available on List<E>, provided by the ListBasics extension

Returns a sorted copy of this list.
sortedCopyBy(Comparable sortKey(E)) List<E>

Available on List<E>, provided by the ListBasics extension

Returns a copy of this list sorted by the value returned by sortKey for each element.
takeRandom({int? seed}) → E?

Available on List<E>, provided by the ListBasics extension

Removes a random element of this and returns it.