Connection constructor
Connection({
- required String id,
- required String sourceNodeId,
- required String sourcePortId,
- required String targetNodeId,
- required String targetPortId,
- bool animated = false,
- bool selected = false,
- Map<
String, dynamic> ? data, - ConnectionStyle? style,
- ConnectionLabel? startLabel,
- ConnectionLabel? label,
- ConnectionLabel? endLabel,
- ConnectionEndPoint? startPoint,
- ConnectionEndPoint? endPoint,
- ConnectionEffect? animationEffect,
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)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);