onDragStart method

  1. @override
void onDragStart(
  1. NodeDragContext context
)
override

Called when a drag operation starts on this node.

Implementation

@override
void onDragStart(NodeDragContext context) {
  // Capture nodes to move based on behavior
  _containedNodeIds = switch (behavior) {
    // Spatial containment - find nodes inside bounds
    GroupBehavior.bounds => context.findNodesInBounds(bounds),
    // Explicit membership - use the explicit node ID set
    GroupBehavior.explicit => Set.from(_nodeIds),
    // Parent-child link - use the explicit node ID set
    GroupBehavior.parent => Set.from(_nodeIds),
  };

  // Ensure child groups have higher z-index than this parent group
  // so they render on top and remain clickable
  _ensureChildGroupsAbove(context);
}