ConnectionTheme constructor
const
ConnectionTheme({
- required ConnectionStyle style,
- required Color color,
- required Color selectedColor,
- required double strokeWidth,
- required double selectedStrokeWidth,
- List<
double> ? dashPattern, - required ConnectionEndPoint startPoint,
- required ConnectionEndPoint endPoint,
- required Color endpointColor,
- required Color endpointBorderColor,
- required double endpointBorderWidth,
- ConnectionEffect? animationEffect,
- required double bezierCurvature,
- required double cornerRadius,
- required double portExtension,
- required double hitTolerance,
- double startGap = 0.0,
- double endGap = 0.0,
Creates a connection theme with the specified visual properties.
Parameters:
style: The connection line style (bezier, smoothstep, straight, etc.)color: Default color for unselected connectionsselectedColor: Color for selected connectionsstrokeWidth: Stroke width for unselected connections in logical pixelsselectedStrokeWidth: Stroke width for selected connections in logical pixelsdashPattern: Optional dash pattern for dashed lines (e.g.,5, 3for 5px dash, 3px gap)startPoint: Endpoint marker for the connection startendPoint: Endpoint marker for the connection endendpointColor: Fill color for endpoint markersendpointBorderColor: Border color for endpoint markersendpointBorderWidth: Border width for endpoint markersanimationEffect: Optional default animation effect for connectionsbezierCurvature: Curvature factor for bezier-style connections (0.0 to 1.0)cornerRadius: Radius for rounded corners in step-style connectionsportExtension: Distance connections extend straight from ports before curvinghitTolerance: Distance tolerance for hit testing in logical pixelsstartGap: Gap between the source port and the start endpoint (default: 0)endGap: Gap between the target port and the end endpoint (default: 0)
Implementation
const ConnectionTheme({
required this.style,
required this.color,
required this.selectedColor,
required this.strokeWidth,
required this.selectedStrokeWidth,
this.dashPattern,
required this.startPoint,
required this.endPoint,
required this.endpointColor,
required this.endpointBorderColor,
required this.endpointBorderWidth,
this.animationEffect,
required this.bezierCurvature,
required this.cornerRadius,
required this.portExtension,
required this.hitTolerance,
this.startGap = 0.0,
this.endGap = 0.0,
});