getLast method

T? getLast(
  1. T item
)

Get the last occurrence of item from the list. Returns null if the item was not found.

Implementation

T? getLast(T item) {
  final index = lastIndexOf(item);
  if (index == -1) return null;
  return this[index];
}