elementAtOrNull method
Returns the index
th element. If the index is out of bounds it will
return null
.
Example:
['a', 'b'].elementAtOrNull(2); // null
Implementation
T elementAtOrNull(int index) => elementAtOrElse(index, () => null as T);
Returns the index
th element. If the index is out of bounds it will
return null
.
Example:
['a', 'b'].elementAtOrNull(2); // null
T elementAtOrNull(int index) => elementAtOrElse(index, () => null as T);