IterableUtilExtensions<T> extension

Extension methods for the Iterable class.

on

Properties

safeFirst → T?

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

Returns the first element of the iterable if it is not empty, otherwise returns null.
no setter
safeLast → T?

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

Returns the last element of the iterable if it is not empty, otherwise returns null.
no setter

Methods

byNameSafe(String name) → T?

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

Returns the element with the given name if it is not empty, otherwise returns null.
exists(T item, {EqualityChecker<T>? equalityChecker}) bool

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

Returns true if the item exists in the iterable, otherwise returns false.
safeAt(int index) → T?

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

Returns the element at the given index if it is not empty, otherwise returns null.