elementAtSafe method

E? elementAtSafe(
  1. int index
)

Same as elementAt but if the index is higher than the length returns null

Implementation

E? elementAtSafe(int index) {
  if (index >= length) {
    return null;
  }
  return elementAt(index);
}