getWhere method

X? getWhere(
  1. bool where(
    1. X element
    )
)

Implementation

X? getWhere(bool Function(X element) where) {
  X? value;
  try {
    value = firstWhere((element) => where(element));
  } catch (e) {
    value = null;
  }
  return value;
}