ListBasics<E> extension

Utility extension methods for the native List class.

on

Methods

slice({int? start, int? end, int step = 1}) List<E>
Returns a new list containing the elements of this from start inclusive to end exclusive, skipping by step.
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.