KtListExtensions<T> extension
- on
-
- KtList<
T>
- KtList<
Properties
-
dart
→ List<
T> -
Available on KtList<
Returns a read-only dart:core ListT> , provided by the KtListExtensions extensionno setter - lastIndex → int
-
Available on KtList<
Returns the index of the last item in the list or -1 if the list is empty.T> , provided by the KtListExtensions extensionno setter
Methods
-
cast<
R> () → KtList< R> -
Available on KtList<
Provides a view of this KtList as an list ofT> , provided by the KtListExtensions extensionR
instances. -
dropLast(
int n) → KtList< T> -
Available on KtList<
Returns a list containing all elements except lastT> , provided by the KtListExtensions extensionn
elements. -
dropLastWhile(
bool predicate(T)) → KtList< T> -
Available on KtList<
Returns a list containing all elements except last elements that satisfy the givenT> , provided by the KtListExtensions extensionpredicate
. -
elementAt(
int index) → T -
Available on KtList<
Returns an element at the givenT> , provided by the KtListExtensions extensionindex
or throws an IndexOutOfBoundsException if theindex
is out of bounds of this list. -
elementAtOrElse(
int index, T defaultValue(int index)) → T -
Available on KtList<
Returns an element at the givenT> , provided by the KtListExtensions extensionindex
or the result of calling thedefaultValue
function if theindex
is out of bounds of this list. -
elementAtOrNull(
int index) → T? -
Available on KtList<
Returns an element at the givenT> , provided by the KtListExtensions extensionindex
ornull
if theindex
is out of bounds of this collection. -
first(
[bool predicate(T)?]) → T -
Available on KtList<
Returns first element.T> , provided by the KtListExtensions extension -
foldRight<
R> (R initial, R operation(T, R acc)) → R -
Available on KtList<
Accumulates value starting withT> , provided by the KtListExtensions extensioninitial
value and applyingoperation
from right to left to each element and current accumulator value. -
foldRightIndexed<
R> (R initial, R operation(int index, T, R acc)) → R -
Available on KtList<
Accumulates value starting withT> , provided by the KtListExtensions extensioninitial
value and applyingoperation
from right to left to each element with its index in the original list and current accumulator value. @paramoperation
function that takes the index of an element, the element itself and current accumulator value, and calculates the next accumulator value. -
getOrElse(
int index, T defaultValue(int)) → T -
Available on KtList<
Returns an element at the givenT> , provided by the KtListExtensions extensionindex
or the result of calling thedefaultValue
function if theindex
is out of bounds of this list. -
getOrNull(
int index) → T? -
Available on KtList<
Returns an element at the givenT> , provided by the KtListExtensions extensionindex
ornull
if theindex
is out of bounds of this list. -
last(
[bool predicate(T)?]) → T -
Available on KtList<
Returns the last element matching the givenT> , provided by the KtListExtensions extensionpredicate
. @throws NoSuchElementException if no such element is found. -
reduceRight<
S> (S operation(T, S acc)) → S -
Available on KtList<
Accumulates value starting with last element and applyingT> , provided by the KtListExtensions extensionoperation
from right to left to each element and current accumulator value. -
reduceRightIndexed<
S> (S operation(int index, T, S acc)) → S -
Available on KtList<
Accumulates value starting with last element and applyingT> , provided by the KtListExtensions extensionoperation
from right to left to each element with its index in the original list and current accumulator value. @paramoperation
function that takes the index of an element, the element itself and current accumulator value, and calculates the next accumulator value. -
single(
[bool predicate(T)?]) → T -
Available on KtList<
Returns the single element matching the givenT> , provided by the KtListExtensions extensionpredicate
, or throws an exception if the list is empty or has more than one element. -
singleOrNull(
[bool predicate(T)?]) → T? -
Available on KtList<
Returns the single element matching the givenT> , provided by the KtListExtensions extensionpredicate
, ornull
if element was not found or more than one element was found. -
slice(
KtIterable< int> indices) → KtList<T> -
Available on KtList<
Returns a list containing elements at specifiedT> , provided by the KtListExtensions extensionindices
. -
takeLast(
int n) → KtList< T> -
Available on KtList<
Returns a list containing lastT> , provided by the KtListExtensions extensionn
elements. -
takeLastWhile(
bool predicate(T)) → KtList< T> -
Available on KtList<
Returns a list containing last elements satisfying the givenT> , provided by the KtListExtensions extensionpredicate
.