elementAt method

T elementAt(
  1. int index
)

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this collection.

Implementation

T elementAt(int index) {
  return elementAtOrElse(index, (int index) {
    throw IndexOutOfBoundsException(
        "Collection doesn't contain element at index: $index.");
  });
}