firstWhereOrNull method

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

Implementation

T? firstWhereOrNull(bool Function(T element) judgeFunc) {
  T? result;
  for (T element in this) {
    if (judgeFunc(element)) {
      result = element;
      break;
    }
  }
  return result;
}