getChildAt<T extends GDisplayObject> method

T getChildAt<T extends GDisplayObject>(
  1. int index
)

Returns the child at a specific index in the list of children of this container.

Implementation

T getChildAt<T extends GDisplayObject>(int index) {
  final len = children.length;
  if (index < 0) index = len + index;
  if (index >= 0 && index < len) {
    return children[index] as T;
  }
  throw RangeError('Invalid child index');
}