lastOrNullWhere method

E? lastOrNullWhere(
  1. bool predicate(
    1. E element
    )
)

Returns the last element matching the given predicate, or null if no such element was found.

Implementation

E? lastOrNullWhere(bool Function(E element) predicate) {
  E? match;
  for (final e in this) {
    if (predicate(e)) {
      match = e;
    }
  }
  return match;
}