tryGet method
Returns the element at the specified index
, or null
if the index is out of bounds.
Implementation
T? tryGet(int index) {
if (isNullOrEmpty) {
return null;
}
return (index < 0 || index >= this!.length) ? null : this![index];
}