Connection constructor

Connection({
  1. required String id,
  2. required String sourceNodeId,
  3. required String sourcePortId,
  4. required String targetNodeId,
  5. required String targetPortId,
  6. bool animated = false,
  7. bool selected = false,
  8. Map<String, dynamic>? data,
  9. ConnectionStyle? style,
  10. ConnectionLabel? startLabel,
  11. ConnectionLabel? label,
  12. ConnectionLabel? endLabel,
  13. ConnectionEndPoint? startPoint,
  14. ConnectionEndPoint? endPoint,
  15. ConnectionEffect? animationEffect,
})

Creates a connection between two ports.

Parameters:

  • id: Unique identifier for this connection
  • sourceNodeId: ID of the node containing the source port
  • sourcePortId: ID of the source port on the source node
  • targetNodeId: ID of the node containing the target port
  • targetPortId: ID of the target port on the target node
  • animated: Whether to show flowing animation on the connection (default: false)
  • selected: Whether the connection is initially selected (default: false)
  • data: Optional arbitrary data to attach to the connection
  • style: Optional custom style override (defaults to theme style if null)
  • startLabel: Optional label at the start of the connection (anchor 0.0)
  • label: Optional label at the center of the connection (anchor 0.5)
  • endLabel: Optional label at the end of the connection (anchor 1.0)
  • startPoint: Optional custom start endpoint marker (defaults to theme if null)
  • endPoint: Optional custom end endpoint marker (defaults to theme if null)
  • animationEffect: Optional animation effect to apply (overrides animated flag)

Implementation

Connection({
  required this.id,
  required this.sourceNodeId,
  required this.sourcePortId,
  required this.targetNodeId,
  required this.targetPortId,
  bool animated = false,
  bool selected = false,
  this.data,
  this.style,
  ConnectionLabel? startLabel,
  ConnectionLabel? label,
  ConnectionLabel? endLabel,
  this.startPoint,
  this.endPoint,
  ConnectionEffect? animationEffect,
}) : _animated = Observable(animated),
     _selected = Observable(selected),
     _startLabel = Observable(startLabel),
     _label = Observable(label),
     _endLabel = Observable(endLabel),
     _animationEffect = Observable(animationEffect);