EditableSmoothStepConnectionStyle class
An editable connection style that creates smooth step paths with rounded corners.
This style maintains the 90-degree turn characteristic of smooth step connections while allowing users to customize the path by adding, moving, or removing control points. The path is rendered as a series of horizontal and vertical segments with smoothly rounded corners.
Features
- Editable flat edges: Users can tweak the horizontal and vertical segments
- Add control points: Insert intermediate waypoints along the path
- Maintain orthogonal routing: All segments remain horizontal or vertical
- Smooth corners: Configurable corner radius for rounded turns
Segment-Based Architecture
This style implements createSegmentsThroughWaypoints as the primary method. All path rendering, hit testing, and bend detection derive from the segments.
Usage Example
// Create a connection with editable smooth step style
final connection = Connection(
id: 'conn-1',
sourceNodeId: 'node-a',
sourcePortId: 'output-1',
targetNodeId: 'node-b',
targetPortId: 'input-1',
style: editableSmoothStepStyle,
controlPoints: [
Offset(150, 100), // First bend point
Offset(150, 200), // Second bend point
],
);
See also:
- EditablePathConnectionStyle for the base editable path functionality
- WaypointBuilder for the underlying path algorithm
- Inheritance
-
- Object
- ConnectionStyle
- EditablePathConnectionStyle
- EditableSmoothStepConnectionStyle
- Available extensions
Constructors
- EditableSmoothStepConnectionStyle({double defaultCornerRadius = 8.0})
-
Creates an editable smooth step connection style.
const
Properties
- defaultCornerRadius → double
-
The default corner radius for rounded corners
final
- defaultHitTolerance → double
-
Default hit tolerance for this connection style.
Some styles may need different tolerances based on their geometry.
no setterinherited
- displayName → String
-
Human-readable display name
no setteroverride
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
Unique identifier for this connection style
no setteroverride
- isBuiltIn → bool
-
Available on ConnectionStyle, provided by the ConnectionStyleExtension extension
Check if this is a built-in connection styleno setter - requiresControlPoints → bool
-
Whether this style requires control points to function.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildHitTestPath(
List< Rect> rects) → Path -
Builds a hit test path from rectangle bounds.
inherited
-
buildHitTestRects(
Offset start, List< PathSegment> segments, double tolerance) → List<Rect> -
Builds hit test rectangles from segments.
inherited
-
buildPath(
Offset start, List< PathSegment> segments) → Path -
Builds a Path from segments.
inherited
-
calculatePointAtPosition(
Path path, double position) → Offset? -
Calculates the position along a path for inserting new control points.
inherited
-
createDefaultPath(
ConnectionPathParameters params) → Path -
Creates the default algorithmic path when no control points are provided.
inherited
-
createDefaultSegments(
ConnectionPathParameters params) → ({List< PathSegment> segments, Offset start}) -
Creates the default algorithmic segments when no control points are provided.
override
-
createPathThroughWaypoints(
List< Offset> waypoints, ConnectionPathParameters params) → Path -
Creates a path through the given waypoints.
inherited
-
createSegments(
ConnectionPathParameters params) → ({List< PathSegment> segments, Offset start}) -
Creates segments for this connection, using control points if available.
inherited
-
createSegmentsThroughWaypoints(
List< Offset> waypoints, ConnectionPathParameters params) → ({List<PathSegment> segments, Offset start}) -
Creates segments through the given waypoints.
override
-
createWaypointsWithEnds(
List< Offset> controlPoints, ConnectionPathParameters params) → List<Offset> -
Helper method to create waypoints including start and end points.
inherited
-
extractBendPoints(
Offset start, List< PathSegment> segments) → List<Offset> -
Extracts bend points from segments.
inherited
-
isEquivalentTo(
ConnectionStyle other) → bool -
Check if two connection styles are equivalent.
This is used for caching decisions and theme comparisons.
inherited
-
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.
override