firstWhereOrNull method
Returns the first element satisfying test, or null if none found.
Implementation
T? firstWhereOrNull(bool Function(T) test) {
for (final element in this) {
if (test(element)) return element;
}
return null;
}
Returns the first element satisfying test, or null if none found.
T? firstWhereOrNull(bool Function(T) test) {
for (final element in this) {
if (test(element)) return element;
}
return null;
}