find method

T? find(
  1. bool f(
    1. T
    )
)

Searches for an element of an iterator that satisfies a predicate.

Implementation

T? find(bool Function(T) f) {
  for (final element in this) {
    if (f(element)) {
      return element;
    }
  }
  return null;
}