firstWhereOrNull method

E? firstWhereOrNull(
  1. bool func(
    1. E
    )
)

Implementation

E? firstWhereOrNull(bool Function(E) func) {
  for (final element in this) {
    if (func(element)) return element;
  }
  return null;
}