TemporaryConnection constructor

TemporaryConnection({
  1. required Offset startPoint,
  2. required String sourceNodeId,
  3. required String sourcePortId,
  4. required Offset initialCurrentPoint,
  5. String? targetNodeId,
  6. String? targetPortId,
})

Creates a temporary connection for drag-and-drop operations.

Parameters:

  • startPoint: The position where the connection starts (source port position)
  • sourceNodeId: ID of the node containing the source port
  • sourcePortId: ID of the source port
  • initialCurrentPoint: Initial pointer position (typically same as startPoint)
  • targetNodeId: Optional ID of the target node (set when hovering over a port)
  • targetPortId: Optional ID of the target port (set when hovering over a port)

Implementation

TemporaryConnection({
  required this.startPoint,
  required this.sourceNodeId,
  required this.sourcePortId,
  required Offset initialCurrentPoint,
  String? targetNodeId,
  String? targetPortId,
}) : _currentPoint = Observable(initialCurrentPoint),
     _targetNodeId = Observable(targetNodeId),
     _targetPortId = Observable(targetPortId);