takeLastTo method

Iterable<E> takeLastTo(
  1. E element
)

Returns the list suffix after the last occurrence of element. If the element is not found return the whole list.

Implementation

Iterable<E> takeLastTo(E element) {
  final index = lastIndexOf(element);
  if (index < 0) return getRange(0, length);
  return getRange(index + 1, length);
}