IterableExtension<T> extension

Extension on Iterable to provide indexed search functionality.

This extension adds a method to find the first element that satisfies a condition, with access to both the element and its index.

The method returns null if no element matches the condition, unlike the standard firstWhere method which throws an exception.

on

Methods

firstWhereIndexedOrNull(bool test(int index, T element)) → T?

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

Finds the first element that satisfies the test condition.