removeNodes method

void removeNodes(
  1. List<VSNodeData> nodeDatas
)

Removes multiple nodes and clears all references

Implementation

void removeNodes(List<VSNodeData> nodeDatas) async {
  for (final node in nodeDatas) {
    _nodes.remove(node.id);
  }
  _nodes = Map.from(_nodes);
  for (final node in _nodes.values) {
    for (final input in node.inputData) {
      if (nodeDatas.contains(input.connectedInterface?.nodeData)) {
        input.connectedInterface = null;
      }
    }
  }
}