findIndex method

int? findIndex(
  1. bool f(
    1. dynamic
    )
)

Find the index of the first element for which f returns true. Advances the stream to that position.

Implementation

int? findIndex(bool Function(dynamic) f) {
  while (!atEnd()) {
    if (f(next())) return index - 1;
  }
  return null;
}