firstWhereOrNull method

T? firstWhereOrNull(
  1. bool predicate(
    1. T element
    )
)

Implementation

T? firstWhereOrNull(bool Function(T element) predicate) {
  try {
    return isEmpty ? null : firstWhere(predicate, orElse: null);
  } catch (e) {
    return null;
  }
}