find method
T?
find(
- dynamic predicate(
- T selector
Returns the first element matching the given predicate
, or null
if element was not found.
Implementation
T? find(predicate(T selector)) {
for (final element in this) {
if (predicate(element)) {
return element;
}
}
return null;
}