ConnectionApi<T> extension
Connection-related operations for NodeFlowController.
This extension provides comprehensive APIs for working with connections:
Model APIs
- getConnection, connectionIds, connectionCount - Lookup operations
- addConnection, removeConnection, createConnection - CRUD operations
Query APIs
- getConnectionsForNode - Get all connections for a node
- getConnectionsFromPort, getConnectionsToPort - Port-specific queries
- getVisibleConnections, getHiddenConnections - Visibility queries
Visual Query APIs
- getConnectionBounds - Bounding box for a connection
- getConnectionPath - The rendered path for a connection
Control Point APIs
- addControlPoint, updateControlPoint, removeControlPoint - CRUD
- clearControlPoints - Remove all control points
Selection APIs
- selectConnection, clearConnectionSelection - Selection management
- selectAllConnections - Bulk selection
Validation APIs
- on
Properties
- connectionCount → int
-
Available on NodeFlowController<
Gets the total number of connections in the graph.T> , provided by the ConnectionApi extensionno setter -
connectionIds
→ Iterable<
String> -
Available on NodeFlowController<
Gets all connection IDs in the graph.T> , provided by the ConnectionApi extensionno setter
Methods
-
addConnection(
Connection connection) → void -
Available on NodeFlowController<
Adds a connection between two ports.T> , provided by the ConnectionApi extension -
addControlPoint(
String connectionId, Offset position, {int? index}) → void -
Available on NodeFlowController<
Adds a control point to a connection at the specified position.T> , provided by the ConnectionApi extension -
cancelConnectionDrag(
) → void -
Available on NodeFlowController<
Cancels a connection drag without creating a connection.T> , provided by the ConnectionApi extension -
canConnect(
{required String targetNodeId, required String targetPortId, bool skipCustomValidation = false}) → ConnectionValidationResult -
Available on NodeFlowController<
Validates whether a connection can be made from the current drag state to the specified target port.T> , provided by the ConnectionApi extension -
canStartConnection(
{required String nodeId, required String portId, required bool isOutput}) → ConnectionValidationResult -
Available on NodeFlowController<
Validates whether a connection can start from the specified port.T> , provided by the ConnectionApi extension -
clearConnectionSelection(
) → void -
Available on NodeFlowController<
Clears all connection selections.T> , provided by the ConnectionApi extension -
clearControlPoints(
String connectionId) → void -
Available on NodeFlowController<
Clears all control points from a connection.T> , provided by the ConnectionApi extension -
completeConnectionDrag(
{required String targetNodeId, required String targetPortId}) → Connection? -
Available on NodeFlowController<
Completes a connection drag by creating the connection.T> , provided by the ConnectionApi extension -
createConnection(
String sourceNodeId, String sourcePortId, String targetNodeId, String targetPortId) → void -
Available on NodeFlowController<
Creates a connection between two ports.T> , provided by the ConnectionApi extension -
deleteAllConnectionsForNode(
String nodeId) → void -
Available on NodeFlowController<
Deletes all connections associated with a node.T> , provided by the ConnectionApi extension -
getConnection(
String connectionId) → Connection? -
Available on NodeFlowController<
Gets a connection by its ID.T> , provided by the ConnectionApi extension -
getConnectionBounds(
String connectionId) → Rect? -
Available on NodeFlowController<
Gets the bounding rectangle for a connection.T> , provided by the ConnectionApi extension -
getConnectionPath(
String connectionId) → Path? -
Available on NodeFlowController<
Gets the rendered path for a connection.T> , provided by the ConnectionApi extension -
getConnectionsForNode(
String nodeId) → List< Connection> -
Available on NodeFlowController<
Gets all connections associated with a node.T> , provided by the ConnectionApi extension -
getConnectionsFromPort(
String nodeId, String portId) → List< Connection> -
Available on NodeFlowController<
Gets all connections originating from a specific port.T> , provided by the ConnectionApi extension -
getConnectionsToPort(
String nodeId, String portId) → List< Connection> -
Available on NodeFlowController<
Gets all connections targeting a specific port.T> , provided by the ConnectionApi extension -
getCycles(
) → List< List< String> > -
Available on NodeFlowController<
Gets all cycles in the graph.T> , provided by the ConnectionApi extension -
getHiddenConnections(
) → List< Connection> -
Available on NodeFlowController<
Gets all hidden connections in the graph.T> , provided by the ConnectionApi extension -
getVisibleConnections(
) → List< Connection> -
Available on NodeFlowController<
Gets all visible connections in the graph.T> , provided by the ConnectionApi extension -
hasCycles(
) → bool -
Available on NodeFlowController<
Checks if the graph contains any cycles.T> , provided by the ConnectionApi extension -
isConnectionSelected(
String connectionId) → bool -
Available on NodeFlowController<
Checks if a connection is currently selected.T> , provided by the ConnectionApi extension -
removeConnection(
String connectionId) → void -
Available on NodeFlowController<
Removes a connection from the graph.T> , provided by the ConnectionApi extension -
removeControlPoint(
String connectionId, int index) → void -
Available on NodeFlowController<
Removes a control point from a connection.T> , provided by the ConnectionApi extension -
selectAllConnections(
) → void -
Available on NodeFlowController<
Selects all connections in the graph.T> , provided by the ConnectionApi extension -
selectConnection(
String connectionId, {bool toggle = false}) → void -
Available on NodeFlowController<
Selects a connection in the graph.T> , provided by the ConnectionApi extension -
startConnectionDrag(
{required String nodeId, required String portId, required bool isOutput, required Offset startPoint, required Rect nodeBounds, Offset? initialScreenPosition}) → ConnectionValidationResult -
Available on NodeFlowController<
Starts a connection drag from a port.T> , provided by the ConnectionApi extension -
updateConnectionDrag(
{required Offset graphPosition, String? targetNodeId, String? targetPortId, Rect? targetNodeBounds}) → void -
Available on NodeFlowController<
Updates a connection drag with the current position.T> , provided by the ConnectionApi extension -
updateControlPoint(
String connectionId, int index, Offset position) → void -
Available on NodeFlowController<
Updates the position of a control point on a connection.T> , provided by the ConnectionApi extension