IterableCorextension<E> extension

on

Properties

isSingle bool
Returns true if the length of the iterable is 1.
read-only

Methods

allOfType<L>() bool
Returns true if all the elements in this are of the given type.
anyOfType<L>() bool
Returns true if any of the elements in this is of the given type.
containsInOrder(Iterable<E> subset) bool
Returns true if the provided elements are found in the list, in the specified order.
count(E element) int
Counts the number of times the value is present in the iterable.
countWhere(bool fn(E element)) int
Counts the number of elements in the iterable that satisfy the fn.
findSingleExtraFrom(Iterable<E> iterable) int
Finds the index of the single extra element in this that is present in the provided iterable.
findSingleMissingFrom(Iterable<E> iterable) int
Finds the index of the single element missing from this that is present in the provided iterable.
findSingleSwappedFrom(Iterable<E> iterable) int
Finds the index of the single different element from this that is present in the provided iterable.
firstWhereNotNull<L>(L fn(E element)) → E
Returns the first element that is not null following the fn map.
firstWhereType<L>([L orElse()]) → L
Returns the first element that is of the given type.
hasSameLengthAs<L>(Iterable<L> iterable) bool
Returns true if the length of this is the same as the length of the provided iterable.
largestWhere(num function(E element)) → E
Given a function that returns a num, returns the element in this that returns the largest value.
productWhere<T extends num>(T function(E element)) → T
Give a function that returns an int or double, returns the product of all the values.
shallowEquals(Iterable<Object> iterable, [Equality equality = const DefaultEquality()]) bool
Given another list, checks whether every element in the two lists are equal.
smallestWhere(num function(E element)) → E
Given a function that returns a num, returns the element in this that returns the smallest value.
startsWith(Iterable<E> iterable) bool
Returns true if this starts with the same elements as the iterable.
sumWhere<T extends num>(T function(E element)) → T
Give a function that returns an int or double, returns the sum of all the values.
whereNotNull<L>(L fn(E element)) Iterable<E>
Returns another iterable where all the elements that are not null (following the fn map).