ConnectionTheme constructor

const ConnectionTheme({
  1. required ConnectionStyle style,
  2. required Color color,
  3. required Color selectedColor,
  4. required double strokeWidth,
  5. required double selectedStrokeWidth,
  6. List<double>? dashPattern,
  7. required ConnectionEndPoint startPoint,
  8. required ConnectionEndPoint endPoint,
  9. required Color endpointColor,
  10. required Color endpointBorderColor,
  11. required double endpointBorderWidth,
  12. ConnectionEffect? animationEffect,
  13. required double bezierCurvature,
  14. required double cornerRadius,
  15. required double portExtension,
  16. required double hitTolerance,
  17. double startGap = 0.0,
  18. 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 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
  • endpointColor: Fill color for endpoint markers
  • endpointBorderColor: Border color for endpoint markers
  • endpointBorderWidth: Border width for endpoint markers
  • 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
  • startGap: 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,
});