firstWhereOrNull method
Implementation
T? firstWhereOrNull(bool Function(T element) test, {T Function()? orElse}) {
int length = this.length;
for (int i = 0; i < length; i++) {
T element = this[i];
if (test(element)) return element;
if (length != this.length) {
throw ConcurrentModificationError(this);
}
}
if (orElse != null) return orElse();
return null;
}