MsIterableUtils<V> extension
- on
-
- Iterable<
V>
- Iterable<
Properties
- firstOrNull → V?
-
Returns first element in array, if it's empty returns null.
no setter
- lastOrNull → V?
-
Returns last element in array, if it's empty returns null.
no setter
Methods
-
containsAll(
Iterable< V> other) → bool -
Check if contains all elements in the
other
list. -
containsAny(
Iterable< V> other) → bool -
Check if contains any elements in the
other
list. -
containsAtLeast(
Iterable< V> other, int atLeast) → bool -
Check if
atLeast
elements in theother
list. -
containsHits(
Iterable< V> other) → int - Count of items that hit both lists
-
diff(
List< V> other) → List<V> -
Elements that you have in this and do not have in
other
. -
firstWhereOrNull(
bool test(V)) → V? -
Return first element that's pass in
test
or null if not found. -
flat(
) → List< V> - Flatting a list that has other lists inside other lists inside other lists ... recursive
-
forEachAsync(
Future< void> forEach(V element), [int parallels = 1]) → Future<void> -
Iterable elements with support async function and runs it's in
parallels
-
groupBySize(
int sizeEachList) → Iterable< Iterable< V> > -
Groups the items into sub-lists of the size given in
sizeEachList
-
intersection(
Iterable< V> other) → Iterable<V> -
Common elements between this list and
other
-
isFirst(
V element) → bool - Returns a true value if element is the first in the list.
-
isFirstIndex(
int index) → bool - Returns a true value if index is the first in the list.
-
isLast(
V element) → bool - Returns a true value if element is the last in the list.
-
isLastIndex(
int index) → bool - Returns a true value if index is the last in the list.
-
joinLast(
[String separator = '', String? last]) → String - It joins all elements of the list with one separator and for the last iteration a different separator.
-
lastWhereOrNull(
bool test(V)) → V? -
Return last element that's pass in
test
or null if not found. -
mapAsStream(
Future< V> forEach(V element), [int parallels = 1]) → Stream<V> -
Iterable elements with support async and emits each
forEach
async ends. -
toMap<
K> (GeneratorKey< V, K> generateKey) → Map<K, V> - Returns a Map with keys that's generated by generator.
-
toStream(
[Duration? interval]) → Stream< V> - Creates a stream with the items in the list.
Operators
-
operator -(
Iterable< V> other) → Iterable<V> -
Elements that you have in this and do not have in
other
. Short operator of the diff function