ConnectionApi<T> extension

Connection-related operations for NodeFlowController.

This extension provides comprehensive APIs for working with connections:

Model APIs

Query APIs

Visual Query APIs

Control Point APIs

Selection APIs

Validation APIs

on

Properties

connectionCount int

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets the total number of connections in the graph.
no setter
connectionIds Iterable<String>

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets all connection IDs in the graph.
no setter

Methods

addConnection(Connection connection) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Adds a connection between two ports.
addControlPoint(String connectionId, Offset position, {int? index}) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Adds a control point to a connection at the specified position.
cancelConnectionDrag() → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Cancels a connection drag without creating a connection.
canConnect({required String targetNodeId, required String targetPortId, bool skipCustomValidation = false}) ConnectionValidationResult

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Validates whether a connection can be made from the current drag state to the specified target port.
canStartConnection({required String nodeId, required String portId, required bool isOutput}) ConnectionValidationResult

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Validates whether a connection can start from the specified port.
clearConnectionSelection() → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Clears all connection selections.
clearControlPoints(String connectionId) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Clears all control points from a connection.
completeConnectionDrag({required String targetNodeId, required String targetPortId}) Connection?

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Completes a connection drag by creating the connection.
createConnection(String sourceNodeId, String sourcePortId, String targetNodeId, String targetPortId) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Creates a connection between two ports.
deleteAllConnectionsForNode(String nodeId) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Deletes all connections associated with a node.
getConnection(String connectionId) Connection?

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets a connection by its ID.
getConnectionBounds(String connectionId) Rect?

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets the bounding rectangle for a connection.
getConnectionPath(String connectionId) Path?

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets the rendered path for a connection.
getConnectionsForNode(String nodeId) List<Connection>

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets all connections associated with a node.
getConnectionsFromPort(String nodeId, String portId) List<Connection>

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets all connections originating from a specific port.
getConnectionsToPort(String nodeId, String portId) List<Connection>

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets all connections targeting a specific port.
getCycles() List<List<String>>

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets all cycles in the graph.
getHiddenConnections() List<Connection>

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets all hidden connections in the graph.
getVisibleConnections() List<Connection>

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Gets all visible connections in the graph.
hasCycles() bool

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Checks if the graph contains any cycles.
isConnectionSelected(String connectionId) bool

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Checks if a connection is currently selected.
removeConnection(String connectionId) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Removes a connection from the graph.
removeControlPoint(String connectionId, int index) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Removes a control point from a connection.
selectAllConnections() → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Selects all connections in the graph.
selectConnection(String connectionId, {bool toggle = false}) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Selects a connection in the graph.
startConnectionDrag({required String nodeId, required String portId, required bool isOutput, required Offset startPoint, required Rect nodeBounds, Offset? initialScreenPosition}) ConnectionValidationResult

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Starts a connection drag from a port.
updateConnectionDrag({required Offset graphPosition, String? targetNodeId, String? targetPortId, Rect? targetNodeBounds}) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Updates a connection drag with the current position.
updateControlPoint(String connectionId, int index, Offset position) → void

Available on NodeFlowController<T>, provided by the ConnectionApi extension

Updates the position of a control point on a connection.