firstWhereOrNull method

V? firstWhereOrNull(
  1. bool where(
    1. V element
    )
)

Returns the first element that satisfies the given test, or null if there is none.

Implementation

V? firstWhereOrNull(bool Function(V element) where) {
  try {
    return values.firstWhere(where);
  } catch (e) {
    return null;
  }
}