tryFind method

T? tryFind(
  1. bool condition(
    1. T
    )
)

Implementation

T? tryFind(bool Function(T) condition) {
  for (final T element in this) {
    if (condition(element)) return element;
  }
  return null;
}