firstWhereOrNull method
Finds the first element that satisfies a condition, or return null.
Implementation
T? firstWhereOrNull(bool Function(T) test) {
for (var element in this) {
if (test(element)) {
return element;
}
}
return null;
}