ListExtensions<E> extension
Various extensions on lists of arbitrary elements.
- on
-
- List<
E>
- List<
Methods
-
binarySearch(
E element, int compare(E, E)) → int -
Available on List<
Returns the index ofE> , provided by the ListExtensions extensionelement
in this sorted list. -
binarySearchBy<
K extends Comparable< (K> >E element, K keyOf(E element), [int start = 0, int? end]) → int -
Available on List<
Returns the index ofE> , provided by the ListExtensions extensionelement
in this sorted list. -
binarySearchByCompare<
K> (E element, K keyOf(E element), int compare(K, K), [int start = 0, int? end]) → int -
Available on List<
Returns the index ofE> , provided by the ListExtensions extensionelement
in this sorted list. -
elementAtOrNull(
int index) → E? -
Available on List<
TheE> , provided by the ListExtensions extensionindex
th element, ornull
if there is no such element. -
equals(
List< E> other, [Equality<E> equality = const DefaultEquality()]) → bool -
Available on List<
WhetherE> , provided by the ListExtensions extensionother
has the same elements as this list. -
expandIndexed<
R> (Iterable< R> expand(int index, E element)) → Iterable<R> -
Available on List<
Expands each element and index to a number of elements in a new iterable.E> , provided by the ListExtensions extension -
forEachIndexed(
void action(int index, E element)) → void -
Available on List<
Takes an action for each element.E> , provided by the ListExtensions extension -
forEachIndexedWhile(
bool action(int index, E element)) → void -
Available on List<
Takes an action for each element and index as long as desired.E> , provided by the ListExtensions extension -
forEachWhile(
bool action(E element)) → void -
Available on List<
Takes an action for each element as long as desired.E> , provided by the ListExtensions extension -
lowerBound(
E element, int compare(E, E)) → int -
Available on List<
Returns the index whereE> , provided by the ListExtensions extensionelement
should be in this sorted list. -
lowerBoundBy<
K extends Comparable< (K> >E element, K keyOf(E), [int start = 0, int? end]) → int -
Available on List<
Returns the index whereE> , provided by the ListExtensions extensionelement
should be in this sorted list. -
lowerBoundByCompare<
K> (E element, K keyOf(E), int compare(K, K), [int start = 0, int? end]) → int -
Available on List<
Returns the index whereE> , provided by the ListExtensions extensionelement
should be in this sorted list. -
mapIndexed<
R> (R convert(int index, E element)) → Iterable< R> -
Available on List<
Maps each element and its index to a new value.E> , provided by the ListExtensions extension -
reverseRange(
int start, int end) → void -
Available on List<
Reverses the elements in a range of the list.E> , provided by the ListExtensions extension -
shuffleRange(
int start, int end, [Random? random]) → void -
Available on List<
Shuffle a range of elements.E> , provided by the ListExtensions extension -
slice(
int start, [int? end]) → ListSlice< E> -
Available on List<
A fixed length view of a range of this list.E> , provided by the ListExtensions extension -
slices(
int length) → Iterable< List< E> > -
Available on List<
Contiguous slices ofE> , provided by the ListExtensions extensionthis
with the givenlength
. -
sortBy<
K extends Comparable< (K> >K keyOf(E element), [int start = 0, int? end]) → void -
Available on List<
Sorts elements by the natural order of theirE> , provided by the ListExtensions extensionkeyOf
property. -
sortByCompare<
K> (K keyOf(E element), int compare(K a, K b), [int start = 0, int? end]) → void -
Available on List<
Sorts elements by theE> , provided by the ListExtensions extensioncompare
of theirkeyOf
property. -
sortRange(
int start, int end, int compare(E a, E b)) → void -
Available on List<
Sort a range of elements byE> , provided by the ListExtensions extensioncompare
. -
swap(
int index1, int index2) → void -
Available on List<
Swaps two elements of this list.E> , provided by the ListExtensions extension -
whereIndexed(
bool test(int index, E element)) → Iterable< E> -
Available on List<
The elements whose value and index satisfiesE> , provided by the ListExtensions extensiontest
. -
whereNotIndexed(
bool test(int index, E element)) → Iterable< E> -
Available on List<
The elements whose value and index do not satisfyE> , provided by the ListExtensions extensiontest
.