onSelectionChanged property
Called when the selection changes. The items that are currently selected will be passed to the callback. This could be empty if nothing is now selected. If TreeView.selectionMode is TreeViewSelectionMode.single then it will contain exactly zero or one items.
Implementation
final TreeViewSelectionChangedCallback? onSelectionChanged;