NinjaUiIterableExtension<E> extension

An extension on Iterable that provides additional utility methods for handling nullable elements and performing common operations.

on

Methods

magicAnd() bool

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns true if all non-null elements in the iterable evaluate to true when converted to a bool.
magicContains(bool condition(E)) bool

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns true if the iterable contains an element that matches the given condition.
magicFilter(bool condition(E)) Iterable<E?>

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Filters elements based on the given condition and returns a new iterable.
magicFilterFalse() List<E>

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns a list of non-null elements in the iterable that evaluate to false when converted to a bool.
magicFilterTrue() List<E>

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns a list of non-null elements in the iterable that evaluate to true when converted to a bool.
magicJoin({String delimiter = ', '}) String

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Joins the string representation of all elements into a single String with a specified delimiter.
magicOr() bool

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns true if any non-null element in the iterable evaluates to true when converted to a bool.
magicProduct() double

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Computes the product of numeric elements in the iterable.
magicSum() double

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Computes the sum of numeric elements in the iterable.
magicToBooleans({bool defaultValue = false}) List<bool>

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns a list of elements converted to booleans by the magicBool method.
magicToDoubles({double defaultValue = 0}) List<double>

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns a list of elements converted to doubles by the magicDouble method.
magicToIntegers({int defaultValue = 0}) List<int>

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns a list of elements converted to integers by the magicInt method.
magicToStrings({String defaultValue = ''}) List<String>

Available on Iterable<E?>, provided by the NinjaUiIterableExtension extension

Returns a list of elements converted to strings by the magicString method.