HeartIterableE<E> extension

Extension methods that maintain types.

on

Methods

backwards() List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Reverses and returns a List.
drop(int n) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Removes first n elements.
dropWhile(bool dropFunction(E sub)) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Removes elements until criteria not met.
elemIndices(E element) List<int>

Available on Iterable<E>, provided by the HeartIterableE extension

Finds each index where element occurs.
filter(bool filterFunction(E element)) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Removes elements that don't meet criteria.
group() List<List<E>>

Available on Iterable<E>, provided by the HeartIterableE extension

Items are in the same sublist if they are equal to the one next to it.
groupBy(bool groupFunction(dynamic a, dynamic b)) List<List<E>>

Available on Iterable<E>, provided by the HeartIterableE extension

Items are in the same sublist if they meet the criteria that compares consecutive elements.

Available on Iterable<E>, provided by the HeartIterableE extension

Returns the first element.
inits() List<List<E>>

Available on Iterable<E>, provided by the HeartIterableE extension

Returns a List of Lists by adding one element at a time, starting from the beginning.
interleave(Iterable<E> it) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Combines elements by taking turns. First element in original iterable is the first element of the result.
intersect(Iterable<E> input) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Keeps all values that are also in input String, using deepEquals.
intersperse(E element) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Inserts an element in between each element.
nub([Iterable<E>? it]) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Removes duplicates by using deepEquals.
replaceAll(E from, [dynamic to]) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Similar to .replaceAll for Strings.
replaceFirst(E from, [dynamic to]) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Similar to .replaceFirst for Strings.
riffleIn() List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Splits into two and uses interleave to combine, second half first.
riffleOut() List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Splits into two and uses interleave to combine.
shuffled({bool cryptographicallySecure = false}) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Returns a shuffled List.
splitAt(int n) List<List<E>>

Available on Iterable<E>, provided by the HeartIterableE extension

Splits into two Lists after first n elements.
subtract(Iterable<E> sublist) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Removes elements one at a time, using deepEquals.
subtractAll(Iterable<E> sublist) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Removes all elements if they are in sublist.
tail() List<E>?

Available on Iterable<E>, provided by the HeartIterableE extension

Removes the first element, keeps the "tail".
tails() List<List<E>>

Available on Iterable<E>, provided by the HeartIterableE extension

Returns a List of Lists by removing one element at a time, starting from the beginning.
toStringList() List<String>

Available on Iterable<E>, provided by the HeartIterableE extension

Converts all elements to Strings.
union(Iterable<E> l) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Adds elements from input that aren't in original value.

Operators

operator *(int n) List<E>

Available on Iterable<E>, provided by the HeartIterableE extension

Repeat elements n times.