lastWhereOrNull method

E? lastWhereOrNull(
  1. bool predicate(
    1. E
    )
)

Find last item in this list fulfilling predicate. Will not evaluate on the remaining items before the found match.

Implementation

E? lastWhereOrNull(bool Function(E) predicate) {
  for (final it in reversed) {
    if (predicate(it)) return it;
  }
  return null;
}