firstOrNull method
Implementation
T? firstOrNull([ bool Function(T item)? predicate ]) {
Iterable<T> iter = this;
if (predicate != null) {
iter = this.where(predicate);
}
if (iter.isEmpty) {
return null;
}
return iter.first;
}
T? firstOrNull([ bool Function(T item)? predicate ]) {
Iterable<T> iter = this;
if (predicate != null) {
iter = this.where(predicate);
}
if (iter.isEmpty) {
return null;
}
return iter.first;
}