PortPosition enum

Defines the position of a port on a node.

This determines which side of the node the port is attached to, affecting both visual placement and connection routing.

Example:

// Create ports on different sides of a node
final leftPort = Port(
  id: 'input',
  name: 'In',
  position: PortPosition.left,
);

final rightPort = Port(
  id: 'output',
  name: 'Out',
  position: PortPosition.right,
);
Inheritance
Available extensions

Values

left → const PortPosition

Port is positioned on the left side of the node

Port is positioned on the right side of the node

top → const PortPosition

Port is positioned on the top side of the node

bottom → const PortPosition

Port is positioned on the bottom side of the node

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
isHorizontal bool

Available on PortPosition, provided by the PortPositionExtension extension

Whether the perpendicular axis is horizontal (left/right ports) or vertical (top/bottom ports).
no setter
isVertical bool

Available on PortPosition, provided by the PortPositionExtension extension

Whether the perpendicular axis is vertical (top/bottom ports).
no setter
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
normal Offset

Available on PortPosition, provided by the PortPositionExtension extension

Returns the outward normal direction for this port position.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateOrigin({required Offset anchorOffset, required Size portSize, required Offset portAdjustment, required bool useAnchorForPerpendicularAxis}) Offset

Available on PortPosition, provided by the PortPositionExtension extension

Calculates the port widget's top-left origin position relative to an anchor.
connectionOffset(Size portSize) Offset

Available on PortPosition, provided by the PortPositionExtension extension

Returns the offset from port's top-left to the connection attachment point.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toOrientation() ShapeDirection

Available on PortPosition, provided by the PortPositionExtension extension

Converts to ShapeDirection for shape-based calculations.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<PortPosition>
A constant List of the values in this enum, in order of their declaration.