T getWithIndex(int index, {T Function(int index)? orElse}) { if (orElse == null) { return this[index]; } return (index < 0 || index >= length) // ? orElse(index) : this[index]; }