where1 method

T? where1(
  1. bool test(
    1. T e
    )
)

Returns the first element that matches test, or null if none match.

Implementation

T? where1(bool Function(T e) test) {
  for (final e in this) {
    if (test(e)) return e;
  }
  return null;
}