isPointInside method

bool isPointInside (
  1. Offset point
)

Returns true if the point is inside the node, the point is in the local coordinate system of the node.

myNode.isPointInside(localPoint);

NodeWithSize provides a basic bounding box check for this method, if you require a more detailed check this method can be overridden.

bool isPointInside (Point nodePoint) {
  double minX = -size.width * pivot.x;
  double minY = -size.height * pivot.y;
  double maxX = minX + size.width;
  double maxY = minY + size.height;
  return (nodePoint.x >= minX && nodePoint.x < maxX &&
  nodePoint.y >= minY && nodePoint.y < maxY);
}

Implementation

bool isPointInside(Offset point) {
  assert(point != null);

  return false;
}