getObjectsUnderPoint method Null safety

List<DisplayObject> getObjectsUnderPoint(
  1. Point<num> point

Returns a list of display objects that lie under the specified point and are children (or grandchildren, and so on) of this display object container.

The point parameter is in the local coordinate system of this display object container.


List<DisplayObject> getObjectsUnderPoint(Point<num> point) {
  final result = <DisplayObject>[];
  final temp = Point<num>(0.0, 0.0);

  for (var child in _children) {
    child.parentToLocal(point, temp);
    if (child is DisplayObjectContainer) {
    } else if (child.bounds.contains(temp.x, temp.y)) {

  return result;