HexagonShape class

A hexagonal node shape.

This shape renders nodes as hexagons, commonly used for:

  • Preparation nodes in flowcharts
  • Processing nodes
  • Configuration or setup steps

The hexagon can be oriented horizontally (flat top/bottom) or vertically (pointed top/bottom). By default, it uses horizontal orientation.

Ports are positioned at the six vertices or the four cardinal directions depending on the use case.

Example:

HexagonShape(
  orientation: HexagonOrientation.horizontal,
  fillColor: Colors.purple,
  strokeColor: Colors.deepPurple,
  strokeWidth: 2.0,
)
Inheritance

Constructors

HexagonShape({HexagonOrientation orientation = HexagonOrientation.horizontal, double sideRatio = 0.2, Color? fillColor, Color? strokeColor, double? strokeWidth})
Creates a hexagon shape.
const

Properties

fillColor → Color?
The fill color for the shape background.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
orientation → HexagonOrientation
The orientation of the hexagon.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sideRatio → double
The ratio of the angled sides to total width/height.
final
strokeColor → Color?
The stroke (border) color for the shape outline.
finalinherited
strokeWidth → double?
The stroke (border) width for the shape outline.
finalinherited

Methods

buildPath(Size size) → Path
Builds the path that defines this shape's outline.
override
containsPoint(Offset point, Size size) → bool
Checks if a point is inside this shape.
override
getBounds(Size size) → Rect
Gets the bounding rectangle for this shape.
override
getPortAnchors(Size size) → List<PortAnchor>
Gets the port anchor points for this shape.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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