firstWhereOrNull method
Return the first element that satisfies the given predicate test
or null
if no element satisfies.
See Iterable.firstWhere.
Implementation
E? firstWhereOrNull(TestPredicate<E> test) {
for (final element in this) {
if (test(element)) return element;
}
return null;
}