firstWhere method

T? firstWhere(
  1. bool fn(
    1. T item
    )
)

Implementation

T? firstWhere(bool Function(T item) fn) {
  reset();

  while (next()) {
    if (fn(value)) {
      return value;
    }
  }
  return null;
}