getOrNull method

T? getOrNull(
  1. int index
)

Element at index, or null if out of range.

Implementation

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