firstOrNull method
Returns the first element that satisfies the given predicate test
or null if no element satisfies the predicate.
Implementation
E? firstOrNull(bool test(E element)) {
for (var e in this) {
if (test(e)) {
return e;
}
}
return null;
}