getElement method
Implementation
E? getElement(int? index) {
if (this == null || index == null || index >= this!.length || index < 0) {
return null;
}
int elementIndex = 0;
for (E element in this!) {
if (index == elementIndex) return element;
elementIndex++;
}
return null;
}