atOrNull method

T? atOrNull(
  1. int index
)
  • return element by index
  • return null if index out of range

Implementation

T? atOrNull(int index) => length - 1 >= index ? elementAt(index) : null;