TreeView<T> constructor
const
TreeView<T> ({})
Creates a TreeView widget.
The nodes
and onSelectionChanged
parameters are required.
The theme
parameter can be used to customize the appearance of the tree view.
Set showSelectAll
to true to display a "Select All" checkbox.
The selectAllWidget
can be used to provide a custom widget for the "Select All" functionality.
Use initialExpandedLevels
to control how many levels of the tree are initially expanded, default is null, no nodes are expanded.
if set to 0, all nodes are expanded, if set to 1, only the root nodes are expanded, if set to 2, the root nodes and their direct children are expanded, and so on.
Set showExpandCollapseButton
to true to display a button that expands or collapses all nodes.
Implementation
const TreeView({
super.key,
required this.nodes,
required this.onSelectionChanged,
this.theme,
this.showSelectAll = false,
this.selectAllWidget,
this.initialExpandedLevels,
this.showExpandCollapseButton = false,
});