ConnectionTheme constructor

const ConnectionTheme({
  1. ConnectionStyle style = ConnectionStyles.smoothstep,
  2. Color color = Colors.grey,
  3. Color selectedColor = Colors.blue,
  4. double strokeWidth = 2.0,
  5. double selectedStrokeWidth = 3.0,
  6. List<double>? dashPattern,
  7. ConnectionEndPoint startPoint = ConnectionEndPoint.none,
  8. ConnectionEndPoint endPoint = ConnectionEndPoint.capsuleHalf,
  9. ConnectionEffect? animationEffect,
  10. double bezierCurvature = 0.3,
  11. double cornerRadius = 4.0,
  12. double portExtension = 20.0,
  13. 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 connections
  • selectedColor: Color for selected connections
  • strokeWidth: Stroke width for unselected connections in logical pixels
  • selectedStrokeWidth: Stroke width for selected connections in logical pixels
  • dashPattern: Optional dash pattern for dashed lines (e.g., 5, 3 for 5px dash, 3px gap)
  • startPoint: Endpoint marker for the connection start
  • endPoint: Endpoint marker for the connection end
  • animationEffect: Optional default animation effect for connections
  • bezierCurvature: Curvature factor for bezier-style connections (0.0 to 1.0)
  • cornerRadius: Radius for rounded corners in step-style connections
  • portExtension: Distance connections extend straight from ports before curving
  • hitTolerance: 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,
});