lastWhereOrNull method

T? lastWhereOrNull(
  1. bool test(
    1. T element
    )
)

Finds the last element that satisfies the given condition, or null if none found

Implementation

T? lastWhereOrNull(bool Function(T element) test) {
  for (var i = length - 1; i >= 0; i--) {
    if (test(this[i])) return this[i];
  }
  return null;
}