firstWhereOrNull method
Returns the first element passing the given test
, or null
if no such
element was found.
Implementation
E? firstWhereOrNull(bool Function(E element) test) {
for (final element in this) {
if (test(element)) return element;
}
return null;
}