findIndex method
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;
}