ConnectionTheme constructor
const
ConnectionTheme({
- ConnectionStyle style = ConnectionStyles.smoothstep,
- Color color = Colors.grey,
- Color selectedColor = Colors.blue,
- double strokeWidth = 2.0,
- double selectedStrokeWidth = 3.0,
- List<
double> ? dashPattern, - ConnectionEndPoint startPoint = ConnectionEndPoint.none,
- ConnectionEndPoint endPoint = ConnectionEndPoint.capsuleHalf,
- ConnectionEffect? animationEffect,
- double bezierCurvature = 0.3,
- double cornerRadius = 4.0,
- double portExtension = 20.0,
- double hitTolerance = 8.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 endanimationEffect: 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 pixels
Implementation
const ConnectionTheme({
this.style = ConnectionStyles.smoothstep,
this.color = Colors.grey,
this.selectedColor = Colors.blue,
this.strokeWidth = 2.0,
this.selectedStrokeWidth = 3.0,
this.dashPattern,
this.startPoint = ConnectionEndPoint.none,
this.endPoint = ConnectionEndPoint.capsuleHalf,
this.animationEffect,
this.bezierCurvature = 0.3,
this.cornerRadius = 4.0,
this.portExtension = 20.0,
this.hitTolerance = 8.0,
});