size method

Positions an AwsNodeSizeNodesSpace node by adjusting its size.

This function takes a node of type AwsNodeSizeNodesSpace and places it in a specific position on the screen. Calculates the position based on the provided offset on the node, the width and height. Returns a Positioned widget containing the node correctly positioned and adjusted in size.

Implementation

Positioned size(AwsNodeSizeNodesSpace node) {
  return Positioned(
    left: node.offset.dx - (node.width / 2),
    top: node.offset.dy - (node.height / 2),
    child: Draggable(
      feedback: Container(),
      child: _AwsDetectorSizeMoveNodesSpace(
        // This method updates the position of the node when it moves.
        onChanged: (Offset offset) => updateNode(node.id, offset),
        node: node,
      ),
    ),
  );
}