ReadyListStateExt<T, S extends ICopyWith<T, S>> extension
Properties
-
first
→ T
-
Returns the first element.
no setter
-
isEmpty
→ bool
-
Whether this collection has no elements.
no setter
-
isNotEmpty
→ bool
-
Whether this collection has at least one element.
no setter
-
last
→ T
-
Returns the last element.
no setter
-
length
→ int
-
Returns the number of elements in this.
no setter
-
single
→ T
-
Checks that this iterable has only one element, and returns that element.
no setter
Methods
-
add(T value, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Adds
value
to the end of this list,
extending the length by one.
-
addAll(Iterable<T> iterable, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Appends all objects of
iterable
to the end of this list.
-
any(bool test(T))
→ bool
-
Checks whether any element of this iterable satisfies
test
.
-
clear([TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Removes all objects from this list; the length of the list becomes zero.
-
contains(T object)
→ bool
-
Whether the collection contains an element equal to
element
.
-
diff(int original, int current)
→ int
-
-
elementAt(int index)
→ T
-
Returns the
index
th element.
-
every(bool test(T))
→ bool
-
Checks whether every element of this iterable satisfies
test
.
-
expand(Iterable<T> toElements(T), [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Expands each element of this Iterable into zero or more elements.
-
firstWhere(bool test(T), {T orElse()?})
→ T
-
Returns the first element that satisfies the given predicate
test
.
-
fold<R>(R initialValue, R combine(R, T))
→ R
-
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
-
followedBy(Iterable<T> other, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Returns the lazy concatenation of this iterable and
other
.
-
forEach(void action(T))
→ void
-
Invokes
action
on each element of this iterable in iteration order.
-
forEachIndex(void action(int i, T item))
→ void
-
Invokes
action
on each element of this iterable in iteration order.
-
insert(int index, T element, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Inserts
element
at position index
in this list.
-
insertAll(int index, Iterable<T> iterable, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Inserts all objects of
iterable
at position index
in this list.
-
lastWhere(bool test(T), {T orElse()?})
→ T
-
Returns the last element that satisfies the given predicate
test
.
-
map(T toElement(T))
→ S
-
The current elements of this iterable modified by
toElement
.
-
reduce(T combine(T, T))
→ T
-
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
-
remove(T value, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Removes the first occurrence of
value
from this list.
-
removeAt(int index, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Removes the object at position
index
from this list.
-
removeLast([TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Removes and returns the last object in this list.
-
removeRange(int start, int end, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Removes a range of elements from the list.
-
removeWhere(bool test(T), [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Removes a range of elements from the list.
-
replaceWhere({required bool where(T), required T item})
→ S
-
replace items where test return
true
-
singleWhere(bool test(T), {T orElse()?})
→ T
-
Returns the single element that satisfies
test
.
-
skip(int count, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Returns an Iterable that provides all but the first
count
elements.
-
skipWhile(bool test(T), [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Returns an
Iterable
that skips leading elements while test
is satisfied.
-
take(int count, [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Returns a lazy iterable of the
count
first elements of this iterable.
-
takeWhile(bool test(T), [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Returns a lazy iterable of the leading elements satisfying
test
.
-
toSet()
→ Set<T>
-
Creates a Set containing the same elements as this iterable.
-
where(bool test(T), [TotalCountResolver totalCountResolver = _defaultResolver])
→ S
-
Returns a new lazy Iterable with all elements that satisfy the
predicate
test
.