PortTheme constructor

const PortTheme({
  1. required Size size,
  2. required Color color,
  3. required Color connectedColor,
  4. required Color highlightColor,
  5. required Color highlightBorderColor,
  6. required Color borderColor,
  7. required double borderWidth,
  8. MarkerShape shape = MarkerShapes.capsuleHalf,
  9. TextStyle? labelTextStyle,
  10. double labelOffset = 4.0,
})

Creates a port theme with the specified visual properties.

All parameters are required to ensure consistent theming across different port states.

Parameters:

  • size: The size of the port in logical pixels (width, height)
  • color: Default color when the port is idle
  • connectedColor: Color when the port has active connections
  • highlightColor: Color when port is highlighted during connection drag
  • highlightBorderColor: Border color when port is highlighted
  • borderColor: Color of the port's border
  • borderWidth: Width of the port's border in logical pixels
  • labelTextStyle: Text style for port labels
  • labelOffset: Distance from port center to label (default: 8.0)
  • shape: Default marker shape for ports (default: capsuleHalf)

Note: Port label visibility is controlled by:

  • Port.showLabel on each port instance
  • The LOD (Level of Detail) system via DetailVisibility.showPortLabels

Implementation

const PortTheme({
  required this.size,
  required this.color,
  required this.connectedColor,
  required this.highlightColor,
  required this.highlightBorderColor,
  required this.borderColor,
  required this.borderWidth,
  this.shape = MarkerShapes.capsuleHalf,
  this.labelTextStyle,
  this.labelOffset = 4.0,
});