TreeNode<T> class

A node in a tree structure.

Each TreeNode represents an item in a hierarchical data structure. It contains information about its state (expanded, selected, etc.), its children, and its parent.

The type parameter T represents the type of the value associated with this node.

Constructors

TreeNode.new({required String label, bool isExpanded = false, bool isSelected = false, bool isPartiallySelected = false, IconData? icon, List<TreeNode<T>>? children, TreeNode<T>? parent, bool hidden = false, int originalIndex = 0, T? value})
Creates a TreeNode.

Properties

children List<TreeNode<T>>
The list of child nodes for this node.
final
hashCode int
The hash code for this object.
no setterinherited
hidden bool
Whether this node is hidden in the tree view.
getter/setter pair
icon IconData?
The icon to display next to this node.
final
isExpanded bool
Whether this node is currently expanded to show its children.
getter/setter pair
isPartiallySelected bool
Whether this node is partially selected (some children selected).
getter/setter pair
isSelected bool
Whether this node is currently selected.
getter/setter pair
label String
The label text displayed for this node.
final
originalIndex int
The original index of this node in its parent's children list.
getter/setter pair
parent TreeNode<T>?
The parent node of this node, or null if this is a root node.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T?
An optional value associated with this node.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited