previousOf method

T previousOf(
  1. T element
)

Implementation

T previousOf(T element) {
  final index = indexOf(element);
  final nextIndex = max(0, index - 1);
  return this[nextIndex];
}