animated method

Positions an animated node from AwsNodeAnimatedNodesSpace.

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

Implementation

Positioned animated(AwsNodeAnimatedNodesSpace node) {
  return Positioned(
    left: node.offset.dx - (node.width / 2),
    top: node.offset.dy - (node.height / 2),
    child: Draggable(
      feedback: Container(),
      child: AwsAniWidget(
        // Configure the animation widget with the node settings.
        setting: node.setting,
        child: _AwsDetectorMoveNodeSpace(
          node: SizedBox(
            height: node.height,
            width: node.width,
            child: node.node,
          ),
          onChanged: (Offset offset) => updateNode(node.id, offset),
        ),
      ),
    ),
  );
}