find method

T? find(
  1. bool predicate(
    1. T? it
    )
)

Returns the first element matching the given predicate, or null if no such element was found.

Implementation

T? find(bool Function(T? it) predicate) =>
    cast<T?>().firstWhere(predicate, orElse: () => null);