mapFirstOrNull<C> method
C?
mapFirstOrNull<C>(
- C? predicateAndMap(
- E
Returns first non-null result of predicateAndMap or null if there
is no non-null results for any item in this iterable.
Implementation
C? mapFirstOrNull<C>(C? Function(E) predicateAndMap) {
for (final item in this) {
final mapped = predicateAndMap(item);
if (mapped != null) {
return mapped;
}
}
return null;
}