lastOrNull method

E? lastOrNull(
  1. bool test(
    1. E element
    )
)

Implementation

E? lastOrNull(bool Function(E element) test) {
  for (var i = length - 1; i >= 0; i--) {
    if (test(elementAt(i))) {
      return elementAt(i);
    }
  }
  return null;
}