NodePortGeometry<T> extension
Extension providing port geometry calculations for nodes.
This extension handles all port position calculations, including:
- Visual port origins (where port widgets render)
- Connection attachment points (where connection lines attach)
- Port centers (for hit testing and highlighting)
The calculations account for node shapes and port-specific offsets, ensuring ports are correctly positioned on various node geometries.
Usage
final connectionPoint = node.getConnectionPoint(
'port-id',
portSize: Size(12, 12),
);
- on
-
- Node<
T>
- Node<
Methods
-
getConnectionPoint(
String portId, {required Size portSize, NodeShape? shape}) → Offset -
Available on Node<
Gets the connection attachment point for a port in graph coordinates.T> , provided by the NodePortGeometry extension -
getPortCapsuleSide(
String portId) → CapsuleFlatSide -
Available on Node<
Gets the capsule flat side orientation for a port.T> , provided by the NodePortGeometry extension -
getPortCenter(
String portId, {required Size portSize, NodeShape? shape}) → Offset -
Available on Node<
Gets the visual center of a port in graph coordinates.T> , provided by the NodePortGeometry extension -
getVisualPortOrigin(
String portId, {required Size portSize, NodeShape? shape}) → Offset -
Available on Node<
Gets the visual position where a port should be rendered within the node container.T> , provided by the NodePortGeometry extension