ElementalOnIterable<T> extension
Get the first element of the Iterable.
If the Iterable is empty, return None.
Functional programming functions on a mutable dart Iterable using elemental
.
- on
-
- Iterable<
T>
- Iterable<
Properties
-
firstOption
→ Option<
T> -
Available on Iterable<
Get the first element of the Iterable. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter -
head
→ Option<
T> -
Available on Iterable<
Get the first element of the Iterable. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter -
init
→ Option<
Iterable< T> > -
Available on Iterable<
Return all the elements of a Iterable except the last one. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter -
lastOption
→ Option<
T> -
Available on Iterable<
Get the last element of the Iterable. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter -
tail
→ Option<
Iterable< T> > -
Available on Iterable<
Return all the elements of a Iterable except the first one. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter
Methods
-
all(
bool test(T t)) → bool -
Available on Iterable<
Checks whether every element of this Iterable satisfiesT> , provided by the ElementalOnIterable extensiontest
. -
ap<
B> (Iterable< B Function(T)> iterable) → Iterable<B> -
Available on Iterable<
Apply all the functions insideT> , provided by the ElementalOnIterable extensioniterable
to this Iterable. -
append(
T element) → Iterable< T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
at the end of the Iterable. -
breakI(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that do not satisfyT> , provided by the ElementalOnIterable extensiontest
and second element is the remainder of the Iterable. -
concat(
Iterable< T> other) → Iterable<T> -
Available on Iterable<
Creates the lazy concatenation of this Iterable andT> , provided by the ElementalOnIterable extensionother
. -
delete(
T element) → Iterable< T> -
Available on Iterable<
Remove the first occurrence ofT> , provided by the ElementalOnIterable extensionelement
from this Iterable. -
drop(
int n) → Iterable< T> -
Available on Iterable<
Return the suffix of this Iterable after the firstT> , provided by the ElementalOnIterable extensionn
elements. -
dropRight(
[int count = 1]) → Iterable< T> -
Available on Iterable<
Drops the lastT> , provided by the ElementalOnIterable extensioncount
element of this iterable. -
dropWhileLeft(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Remove all elements starting from the first as long asT> , provided by the ElementalOnIterable extensiontest
returnstrue
. -
elem(
T element) → bool -
Available on Iterable<
Check ifT> , provided by the ElementalOnIterable extensionelement
is contained inside this Iterable. -
filter(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Returns the list of those elements that satisfyT> , provided by the ElementalOnIterable extensiontest
. -
filterWithIndex(
bool test(T t, int index)) → Iterable< T> -
Available on Iterable<
Returns the list of those elements that satisfyT> , provided by the ElementalOnIterable extensiontest
. -
flatMap<
B> (Iterable< B> toElements(T t)) → Iterable<B> -
Available on Iterable<
For each element of the Iterable apply functionT> , provided by the ElementalOnIterable extensiontoElements
and flat the result. -
flatMapWithIndex<
B> (Iterable< B> toElements(T t, int index)) → Iterable<B> -
Available on Iterable<
Same asT> , provided by the ElementalOnIterable extensionflatMap
(extend
) but provides also theindex
of each mapped element in the mapping function (toElements
). -
foldLeft<
B> (B initialValue, B combine(B b, T t)) → B -
Available on Iterable<
Fold this Iterable into a single value by aggregating each element of the list from the first to the last.T> , provided by the ElementalOnIterable extension -
foldLeftWithIndex<
B> (B initialValue, B combine(B previousValue, T element, int index)) → B -
Available on Iterable<
Same asT> , provided by the ElementalOnIterable extensionfoldLeft
(fold
) but provides also theindex
of each mapped element in thecombine
function. -
insertBy(
Order< T> order, T element) → Iterable<T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
into the list at the first position where it is less than or equal to the next element based onorder
(Order). -
insertWith<
A> (A extract(T instance), Order< A> order, T element) → Iterable<T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
into the Iterable at the first position where it is less than or equal to the next element based onorder
(Order). -
intersect(
Iterable< T> iterable) → Iterable<T> -
Available on Iterable<
Return the intersection of two Iterable (all the elements that both Iterable have in common).T> , provided by the ElementalOnIterable extension -
intersperse(
T middle) → Iterable< T> -
Available on Iterable<
Return an Iterable placing anT> , provided by the ElementalOnIterable extensionmiddle
in between elements of the this Iterable. -
mapWithIndex<
B> (B toElement(T t, int index)) → Iterable< B> -
Available on Iterable<
Same asT> , provided by the ElementalOnIterable extensionmap
but provides also theindex
of each mapped element in the mapping function (toElement
). -
maximumBy(
Order< T> order) → Option<T> -
Available on Iterable<
The largest element of this Iterable based onT> , provided by the ElementalOnIterable extensionorder
. -
minimumBy(
Order< T> order) → Option<T> -
Available on Iterable<
The least element of this Iterable based onT> , provided by the ElementalOnIterable extensionorder
. -
notElem(
T element) → bool -
Available on Iterable<
Check ifT> , provided by the ElementalOnIterable extensionelement
is not contained inside this Iterable. -
partition(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record containing the values of this Iterable for whichT> , provided by the ElementalOnIterable extensiontest
isfalse
in the first element, and the values for which it istrue
in the second element. -
prepend(
T element) → Iterable< T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
at the beginning of the Iterable. -
prependAll(
Iterable< T> other) → Iterable<T> -
Available on Iterable<
Insert all the elements insideT> , provided by the ElementalOnIterable extensionother
at the beginning of the Iterable. -
sortBy(
Order< T> order) → List<T> -
Available on Iterable<
Sort this List based onT> , provided by the ElementalOnIterable extensionorder
(Order). -
sortWith<
A> (A extract(T t), Order< A> order) → List<T> -
Available on Iterable<
Sort this Iterable based onT> , provided by the ElementalOnIterable extensionorder
of an object of typeA
extracted fromT
usingextract
. -
sortWithDate(
DateTime getDate(T instance)) → List< T> -
Available on Iterable<
Sort this Iterable based on DateTime extracted from typeT> , provided by the ElementalOnIterable extensionT
usinggetDate
. -
span(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that satisfyT> , provided by the ElementalOnIterable extensiontest
and second element is the remainder of the Iterable. -
splitAt(
int n) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is an Iterable with the firstT> , provided by the ElementalOnIterable extensionn
elements of this Iterable, and the second element contains the rest of the Iterable. -
takeWhileLeft(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Extract all elements starting from the first as long asT> , provided by the ElementalOnIterable extensiontest
returnstrue
. -
zip<
B> (Iterable< B> iterable) → Iterable<(T, B)> -
Available on Iterable<
T> , provided by the ElementalOnIterable extensionzip
is used to join elements at the same index from two different Iterable into one Iterable of a record. -
zipWith<
B, C> (C combine(T t, B b), Iterable< B> iterable) → Iterable<C> -
Available on Iterable<
Join elements at the same index from two different Iterable into one Iterable containing the result of callingT> , provided by the ElementalOnIterable extensioncombine
on each element pair.