ConnectionsCanvas<T> class

Custom painter for rendering all connections in the node flow canvas.

This painter is responsible for drawing connection lines and their endpoint markers (but not labels, which are rendered in a separate layer for performance reasons).

Performance Considerations

  • Uses a shared ConnectionPainter for path caching and reuse
  • Relies on InteractiveViewer for viewport clipping (no manual culling)
  • Separates connection rendering from label rendering for better performance
  • Supports animated connections via Animation parameter

Usage

This painter is used internally by the node flow rendering system and typically doesn't need to be instantiated directly by users.

CustomPaint(
  painter: ConnectionsCanvas<MyDataType>(
    store: controller,
    theme: theme,
    connectionPainter: sharedPainter,
    animation: animationController,
  ),
)

See also:

Inheritance

Constructors

ConnectionsCanvas({required NodeFlowController<T> store, required NodeFlowTheme theme, required ConnectionPainter connectionPainter, Animation<double>? animation})
Creates a connections canvas painter.
const

Properties

animation Animation<double>?
Optional animation for animated connections.
final
connectionPainter ConnectionPainter
Shared connection painter instance for path caching and reuse.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticsBuilder SemanticsBuilderCallback?
Returns a function that builds semantic information for the picture drawn by this painter.
no setterinherited
store NodeFlowController<T>
The node flow controller containing all connection data.
final
theme NodeFlowTheme
The visual theme for rendering connections.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be notified when it is time to repaint.
inherited
hitTest(Offset position) bool?
Called whenever a hit test is being performed on an object that is using this custom paint delegate.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Canvas canvas, Size size) → void
Paints all connections in the node flow.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies when it is time to repaint.
inherited
shouldRebuildSemantics(covariant ConnectionsCanvas<T> oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
override
shouldRepaint(covariant ConnectionsCanvas<T> oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
override
toString() String
A string representation of this object.
inherited

Operators

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