firstWhereIndexedOrNull method Null safety
The first element whose value and index satisfies test
.
Returns null
if there are no element and index satisfying test
.
Implementation
T? firstWhereIndexedOrNull(bool Function(int index, T element) test) {
var index = 0;
for (var element in this) {
if (test(index++, element)) return element;
}
return null;
}