ConnectionPathCalculator class

Utility class for creating connection paths from style definitions.

This calculator serves as a facade for the polymorphic ConnectionStyle system, providing a simple static method to create paths while handling backward compatibility and style resolution.

Design Pattern

This class uses the Strategy pattern, delegating path creation to the appropriate ConnectionStyle implementation based on the provided style parameter.

Usage Example

final path = ConnectionPathCalculator.createConnectionPath(
  style: ConnectionStyles.smoothstep,
  start: Offset(10, 20),
  end: Offset(100, 80),
  curvature: 0.5,
  sourcePort: outputPort,
  targetPort: inputPort,
);

See also:

Constructors

ConnectionPathCalculator()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

createConnectionPath({required dynamic style, required Offset start, required Offset end, required double curvature, Port? sourcePort, Port? targetPort, double cornerRadius = 4.0, double offset = 10.0}) Path
Creates a connection path based on the connection style and parameters.