indexOfLast method
Returns index of the last element passing the given test
, or -1
if
the collection does not contain such element.
Implementation
int indexOfLast(bool Function(E element) test) {
var lastIndex = -1;
var index = 0;
for (final element in this) {
if (test(element)) lastIndex = index;
index++;
}
return lastIndex;
}