firstWhereOrNull method
Returns the first value found by searching based on the condition specified in test
.
If the value is not found, Null is returned.
Implementation
T? firstWhereOrNull(bool Function(T item) test) {
if (isEmpty) {
return null;
}
for (final element in this) {
if (test(element)) {
return element;
}
}
return null;
}