hoverAnimated method

hoverAnimated Positions a hover node of type AwsNodeHoverAnimatedNodesSpace.

This function takes a node of type AwsNodeHoverAnimatedNodesSpace 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 with the hover animation effect.

Implementation

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