negativeIndex method Null safety

E negativeIndex(
  1. int index
)

Similar to negative index in python [-1] will return the last thing in the list 0 or over will return its [] operator

Implementation

E negativeIndex(int index) {
  while (index < 0) {
    index += length;
  }
  return this[index];
}