at<T extends NativeType> method
Returns the element at the specified index.
index
: The index of the element to retrieve. Returns a pointer to the element at the specified index. Throws aRangeError
if the index is out of bounds.
Implementation
Pointer<T> at<T extends NativeType>(int index) {
if (index < 0 || index >= length) {
throw RangeError('Index out of bounds');
}
return (data + (index * elementSize)).cast<T>();
}