PortDefinition class final

A connection port declared by a shape: an id, where it sits (placement) and how it is drawn (style).

Constructors

PortDefinition({required String id, required PortPlacement placement, PortStyle style = const PortStyle()})
const
PortDefinition.fromInstance(Port instance, {PortStyle? style})
factory
PortDefinition.normalized({required String id, required DiagramPoint anchor, required DiagramPoint outwardNormal, String? targetLayerId, PortStyle style = const PortStyle()})
factory
PortDefinition.onSide({required String id, required PortSide side, double position = 0.5, String? targetLayerId, PortStyle style = const PortStyle()})
Creates a port on one side of the shape. position is normalized along that side from left-to-right or top-to-bottom.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
id → String
final
outwardNormal → DiagramPoint
The declarative direction in which a route leaves this port, expressed in the owning shape's local coordinate system.
no setter
placement → PortPlacement
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style → PortStyle
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveCenter(DiagramRect target) → DiagramPoint
resolveOutline(DiagramRect target, DiagramPortShapeRegistry shapes, {double inset = 0}) → ResolvedOutline
The marker contour placed on target, oriented by the outward normal. A positive inset shrinks it toward its centre for the connected fill.
toString() → String
A string representation of this object.
inherited

Operators

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