elementAtOrNull method

T? elementAtOrNull(
  1. int index
)

Returns the element at index or null when out of bounds.

Implementation

T? elementAtOrNull(int index) =>
    (index < 0 || index >= length) ? null : this[index];