getConnectionsForNode method

List<Connection> getConnectionsForNode(
  1. String nodeId
)

Gets all connections associated with a node.

Returns connections where the node is either the source or target.

Example:

final connections = controller.getConnectionsForNode('node1');
print('Node has ${connections.length} connections');

Implementation

List<Connection> getConnectionsForNode(String nodeId) {
  return _connections
      .where(
        (conn) => conn.sourceNodeId == nodeId || conn.targetNodeId == nodeId,
      )
      .toList();
}