deleteAllConnectionsForNode method
Deletes all connections associated with a node.
Removes all connections where the node is either the source or target. The node itself is not deleted.
Parameters:
nodeId: The ID of the node whose connections should be removed
Example:
controller.deleteAllConnectionsForNode('node1');
Implementation
void deleteAllConnectionsForNode(String nodeId) {
final connectionsToRemove = _connections
.where(
(conn) => conn.sourceNodeId == nodeId || conn.targetNodeId == nodeId,
)
.toList();
runInAction(() {
for (final conn in connectionsToRemove) {
_connections.remove(conn);
}
});
}