firstIndexOf method

int firstIndexOf(
  1. bool test(
    1. E element
    )
)

Implementation

int firstIndexOf(bool Function(E element) test) {
  var index = 0;
  for (final element in this) {
    if (test(element)) {
      return index;
    }
    index++;
  }
  return -1;
}