offset property
Position offset that specifies where the CENTER of the port should be.
The offset interpretation depends on the port's position:
- Left/Right ports:
offset.dyis the vertical center position (distance from the top of the node).offset.dxadjusts the horizontal position from the edge. - Top/Bottom ports:
offset.dxis the horizontal center position (distance from the left of the node).offset.dyadjusts the vertical position from the edge.
Example for a 150x100 node:
// Right port centered vertically at 50 (middle of node)
Port(position: PortPosition.right, offset: Offset(0, 50))
// Top port centered horizontally at 75 (middle of node width)
Port(position: PortPosition.top, offset: Offset(75, 0))
// Two right ports at 1/3 and 2/3 height
Port(position: PortPosition.right, offset: Offset(0, 33))
Port(position: PortPosition.right, offset: Offset(0, 67))
Implementation
@OffsetConverter()
final Offset offset;