firstWhereIndexedOrNull method

T? firstWhereIndexedOrNull(
  1. bool test(
    1. int index,
    2. T element
    )
)

Implementation

T? firstWhereIndexedOrNull(bool Function(int index, T element) test) {
  var index = 0;
  for (var element in this) {
    if (test(index++, element)) return element;
  }
  return null;
}