ConnectionPathCache class

Manages connection path caching and hit testing Separates concerns from ConnectionPainter

Constructors

ConnectionPathCache({required NodeFlowTheme theme, NodeShape? nodeShape(Node node)?})

Properties

defaultHitTolerance double
Get the hit tolerance from the connection theme
no setter
hashCode int
The hash code for this object.
no setterinherited
nodeShape NodeShape? Function(Node node)?
Optional function to get the shape for a node. Used to calculate correct port positions for shaped nodes.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme NodeFlowTheme
no setter

Methods

clearAll() → void
Clear all cached paths
dispose() → void
Dispose and clean up
getHitTestPath(String connectionId) Path?
Get the cached hit test path for debugging purposes
getOrCreatePath({required Connection connection, required Node sourceNode, required Node targetNode, required ConnectionStyle connectionStyle}) Path?
Get or create cached path during painting operations This is the only place where paths should be created
getOriginalPath(String connectionId) Path?
Get the cached original path for debugging purposes
getStats() Map<String, dynamic>
Get cache statistics
hasConnection(String connectionId) bool
Check if connection has cached path
hitTest({required Connection connection, required Node sourceNode, required Node targetNode, required Offset testPoint, double? tolerance}) bool
Test if a point hits a connection path Returns true if the point is within the hit tolerance of the connection
invalidateAll() → void
Invalidate all cached paths
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeConnection(String connectionId) → void
Remove cached path when connection is deleted
toString() String
A string representation of this object.
inherited
updateTheme(NodeFlowTheme newTheme) → void
Update the theme and intelligently invalidate cache if needed

Operators

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