findMap<U> method

U? findMap<U>(
  1. U? f(
    1. T
    )
)

Applies the function to the elements of iterator and returns the first non-(none/null) result.

Implementation

U? findMap<U>(U? Function(T) f) {
  for (final element in this) {
    final result = f(element);
    if (result != null) {
      return result;
    }
  }
  return null;
}