elementAtOrNull method

T? elementAtOrNull({
  1. required int index,
})

Safely returns the element at index, or null if out of range.

Implementation

T? elementAtOrNull({required int index}) =>
    (index >= 0 && index < length) ? this[index] : null;