find method

E? find(
  1. Predicate<E> predicate
)

Returns the first element matching predicate, or null if element was not found.

Implementation

E? find(Predicate<E> predicate) {
  for (final element in this) {
    if (predicate(element)) {
      return element;
    }
  }

  return null;
}