indexWhereOrNull method

int? indexWhereOrNull(
  1. ConditionTester<T> test
)

Finds the index of an element that satisfies the predicate or returns null if not found.

Implementation

int? indexWhereOrNull(ConditionTester<T> test) {
  for (var i = 0; i < length; i++) {
    if (test(elementAt(i))) return i;
  }
  return null;
}