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

Properties

firstOption → Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Get the first element of the Iterable. If the Iterable is empty, return None.
no setter

Available on Iterable<T>, provided by the ElementalOnIterable extension

Get the first element of the Iterable. If the Iterable is empty, return None.
no setter
init → Option<Iterable<T>>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return all the elements of a Iterable except the last one. If the Iterable is empty, return None.
no setter
lastOption → Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Get the last element of the Iterable. If the Iterable is empty, return None.
no setter
tail → Option<Iterable<T>>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return all the elements of a Iterable except the first one. If the Iterable is empty, return None.
no setter

Methods

all(bool test(T t)) → bool

Available on Iterable<T>, provided by the ElementalOnIterable extension

Checks whether every element of this Iterable satisfies test.
ap<B>(Iterable<B Function(T)> iterable) → Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Apply all the functions inside iterable to this Iterable.
append(T element) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element at the end of the Iterable.
breakI(bool test(T t)) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that do not satisfy test and second element is the remainder of the Iterable.
concat(Iterable<T> other) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Creates the lazy concatenation of this Iterable and other.
delete(T element) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Remove the first occurrence of element from this Iterable.
drop(int n) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return the suffix of this Iterable after the first n elements.
dropRight([int count = 1]) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Drops the last count element of this iterable.
dropWhileLeft(bool test(T t)) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Remove all elements starting from the first as long as test returns true.
elem(T element) → bool

Available on Iterable<T>, provided by the ElementalOnIterable extension

Check if element is contained inside this Iterable.
filter(bool test(T t)) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Returns the list of those elements that satisfy test.
filterWithIndex(bool test(T t, int index)) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Returns the list of those elements that satisfy test.
flatMap<B>(Iterable<B> toElements(T t)) → Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

For each element of the Iterable apply function toElements and flat the result.
flatMapWithIndex<B>(Iterable<B> toElements(T t, int index)) → Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Same as flatMap (extend) but provides also the index of each mapped element in the mapping function (toElements).
foldLeft<B>(B initialValue, B combine(B b, T t)) → B

Available on Iterable<T>, provided by the ElementalOnIterable extension

Fold this Iterable into a single value by aggregating each element of the list from the first to the last.
foldLeftWithIndex<B>(B initialValue, B combine(B previousValue, T element, int index)) → B

Available on Iterable<T>, provided by the ElementalOnIterable extension

Same as foldLeft (fold) but provides also the index of each mapped element in the combine function.
insertBy(Order<T> order, T element) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element into the list at the first position where it is less than or equal to the next element based on order (Order).
insertWith<A>(A extract(T instance), Order<A> order, T element) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element into the Iterable at the first position where it is less than or equal to the next element based on order (Order).
intersect(Iterable<T> iterable) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return the intersection of two Iterable (all the elements that both Iterable have in common).
intersperse(T middle) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return an Iterable placing an middle in between elements of the this Iterable.
mapWithIndex<B>(B toElement(T t, int index)) → Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Same as map but provides also the index of each mapped element in the mapping function (toElement).
maximumBy(Order<T> order) → Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

The largest element of this Iterable based on order.
minimumBy(Order<T> order) → Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

The least element of this Iterable based on order.
notElem(T element) → bool

Available on Iterable<T>, provided by the ElementalOnIterable extension

Check if element is not contained inside this Iterable.
partition(bool test(T t)) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record containing the values of this Iterable for which test is false in the first element, and the values for which it is true in the second element.
prepend(T element) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element at the beginning of the Iterable.
prependAll(Iterable<T> other) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert all the elements inside other at the beginning of the Iterable.
sortBy(Order<T> order) → List<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Sort this List based on order (Order).
sortWith<A>(A extract(T t), Order<A> order) → List<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Sort this Iterable based on order of an object of type A extracted from T using extract.
sortWithDate(DateTime getDate(T instance)) → List<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Sort this Iterable based on DateTime extracted from type T using getDate.
span(bool test(T t)) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that satisfy test and second element is the remainder of the Iterable.
splitAt(int n) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record where first element is an Iterable with the first n elements of this Iterable, and the second element contains the rest of the Iterable.
takeWhileLeft(bool test(T t)) → Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Extract all elements starting from the first as long as test returns true.
zip<B>(Iterable<B> iterable) → Iterable<(T, B)>

Available on Iterable<T>, provided by the ElementalOnIterable extension

zip 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<T>, provided by the ElementalOnIterable extension

Join elements at the same index from two different Iterable into one Iterable containing the result of calling combine on each element pair.