PathSegment class sealed
Base class for path segment primitives.
Path segments represent the building blocks of connection paths. Each segment defines how to draw from the current point to end, and knows how to generate its own hit test rectangles.
Available Segment Types
- StraightSegment: Direct line to endpoint
- QuadraticSegment: Quadratic bezier curve (one control point)
- CubicSegment: Cubic bezier curve (two control points)
Usage Example
final segments = <PathSegment>[
StraightSegment(end: Offset(100, 50)), // Horizontal segment
QuadraticSegment(
controlPoint: Offset(100, 75),
end: Offset(100, 100),
generateHitTestRects: false, // Corner already covered by adjacent segments
), // Rounded corner
StraightSegment(end: Offset(60, 100)), // Vertical segment
];
- Implementers
Properties
- end → Offset
-
The endpoint of this segment.
final
- generateHitTestRects → bool
-
Whether to generate hit test rectangles for this segment.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getHitTestRects(
Offset start, double tolerance) → List< Rect> - Generates hit test rectangles for this segment.
-
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
Static Methods
-
maxHitTestSize(
double tolerance) → double - Returns the maximum hit test box dimension for a given tolerance.
Constants
- hitTestSizeMultiplier → const double
- Multiplier for determining maximum hit test rectangle size.