TreeNode<T> constructor
TreeNode<T> ({})
Creates a TreeNode.
The label
parameter is required and specifies the widget to display for this node.
The value
parameter is an optional value associated with this node.
The icon
parameter specifies the icon to display next to the node.
The trailing
parameter specifies the widget to display after the node.
The data
parameter is an optional map of extra data associated with this node.
The isSelected
parameter controls the initial selection state of the node.
The children
parameter is an optional list of child nodes.
Implementation
factory TreeNode({
required Widget label,
T? value,
Icon? icon,
Widget Function(BuildContext context, TreeNode<T> node)? trailing,
dynamic data,
bool isSelected = false,
List<TreeNode<T>>? children,
}) {
return TreeNode._internal(
label: label,
value: value,
icon: icon,
trailing: trailing,
data: data,
children: children ?? [],
isSelected: isSelected,
);
}