elementAtOrNull method Null safety
- int index
indexth element, or
null if there is no such element.
Returns the element at position
index of this list,
just like elementAt, if this list has such an element.
If this list does not have enough elements to have one with the given
null value is returned, unlike elementAt which throws
index must not be negative.
E? elementAtOrNull(int index) => (index < length) ? this[index] : null;