selectNodesById method

void selectNodesById(
  1. Set<String> ids, {
  2. bool holdSelection = false,
  3. bool isHandled = false,
})

This method is used to select nodes by their IDs.

Emits a NodeSelectionEvent event.

Implementation

void selectNodesById(
  Set<String> ids, {
  bool holdSelection = false,
  bool isHandled = false,
}) async {
  if (ids.isEmpty) {
    return clearSelection();
  } else if (!holdSelection) {
    clearSelection();
  }

  selectedNodeIds.addAll(ids);

  for (final id in selectedNodeIds) {
    final node = nodes[id];
    node?.state.isSelected = true;
  }

  // eventBus.emit(
  //   SelectionEvent(id: const Uuid().v4(), selectedNodeIds.toSet()),
  // );
}