collapseNode method
Collapses the TreeViewNode that was built with this controller.
If the node is already in the collapsed state (see isExpanded), calling this method has no effect.
Calling this method may cause the TreeView to rebuild, so it may not be called from a build method.
Calling this method will trigger the TreeView.onNodeToggle callback.
See also:
- expandNode, which expands the tile.
- isExpanded to check whether the tile is expanded.
- TreeView.controller to create an TreeView with a controller.
Implementation
void collapseNode(TreeViewNode<Object?> node) {
assert(_state != null);
if (node.isExpanded) {
_state!.toggleNode(node);
}
}