getOverlappingNodes method

List<Node<E>> getOverlappingNodes(
  1. Node<E> targetNode,
  2. Size nodeSize
)

Returns all nodes that potentially overlap with the given node

This is optimized for drag-and-drop collision detection

Implementation

List<Node<E>> getOverlappingNodes(Node<E> targetNode, Size nodeSize) {
  final nodeRect = _getNodeRect(targetNode, nodeSize);

  // Expand search area slightly to account for near-misses
  final searchBounds = nodeRect.inflate(nodeSize.width * 0.1);

  return getNodesInBounds(searchBounds, nodeSize);
}