onNodeToggle property

TreeViewNodeCallback<T>? onNodeToggle
final

Called when a TreeViewNode is toggled to expand or collapse.

This will be called before the collapse or expand animation starts, but after the TreeViewNode.isExpanded value is updated. This means that TreeViewNode.isExpanded will reflect the value it is transitioning to as a result of being toggled.

This will not be called if a TreeViewNode does not have any children.

Implementation

final TreeViewNodeCallback<T>? onNodeToggle;