distanceToElementWhere method
Calculate how far back in the stack a matching element is.
Returns null if not found.
Implementation
int? distanceToElementWhere(bool Function(E element) test) {
final pos = _list.lastIndexWhere(test);
if (pos == -1) {
return null;
}
final distance = _list.length - pos - 1;
return distance;
}