updateNode method

void updateNode(
  1. TreeNode<TKey, TData> node
)

Updates the data payload for an existing node without structural changes.

Preserves the node's position, expansion state, and animation state. Notifies listeners so that mounted widgets rebuild with the new data.

Implementation

void updateNode(TreeNode<TKey, TData> node) {
  assert(_hasKey(node.key), 'Node ${node.key} not found');
  _adoptKey(node.key);
  _store.setData(node.key, node);
  // Data-only change: no structural mutation, no visible order shift,
  // no expansion/hasChildren change. Fire the targeted data channel
  // so the element rebuilds only this row instead of sweeping every
  // mounted child.
  _notifyNodeDataChanged(node.key);
}