Connection<C> constructor
Connection<C> ({
- required String id,
- required String sourceNodeId,
- required String sourcePortId,
- required String targetNodeId,
- required String targetPortId,
- bool animated = false,
- bool selected = false,
- C? data,
- ConnectionStyle? style,
- ConnectionLabel? startLabel,
- ConnectionLabel? label,
- ConnectionLabel? endLabel,
- ConnectionEndPoint? startPoint,
- ConnectionEndPoint? endPoint,
- double? startGap,
- double? endGap,
- ConnectionEffect? animationEffect,
- bool locked = false,
- Color? color,
- Color? selectedColor,
- double? strokeWidth,
- double? selectedStrokeWidth,
Creates a connection between two ports.
Parameters:
id: Unique identifier for this connectionsourceNodeId: ID of the node containing the source portsourcePortId: ID of the source port on the source nodetargetNodeId: ID of the node containing the target porttargetPortId: ID of the target port on the target nodeanimated: 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 connectionstyle: 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)startGap: Optional gap between source port and start endpoint (defaults to theme if null)endGap: Optional gap between target port and end endpoint (defaults to theme if null)animationEffect: Optional animation effect to apply (overrides animated flag)locked: Whether this connection is locked from deletion (default: false)color: Optional custom color for the connection line (overrides theme)selectedColor: Optional custom color when the connection is selected (overrides theme)strokeWidth: Optional custom stroke width for the connection line (overrides theme)selectedStrokeWidth: Optional custom stroke width when selected (overrides theme)
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,
this.startGap,
this.endGap,
ConnectionEffect? animationEffect,
this.locked = false,
this.color,
this.selectedColor,
this.strokeWidth,
this.selectedStrokeWidth,
}) : _animated = Observable(animated),
_selected = Observable(selected),
_startLabel = Observable(startLabel),
_label = Observable(label),
_endLabel = Observable(endLabel),
_animationEffect = Observable(animationEffect);