elementAtOrNull method

T? elementAtOrNull(
  1. int index
)

Returns the element at index, or null if out of bounds

Implementation

T? elementAtOrNull(int index) {
  if (index < 0 || index >= length) return null;
  return this[index];
}