TreeNode<T> class

Represents a node in the TreeView hierarchy.

Example:

final node = TreeNode<String>(
  ValueKey('root'),
  'Root Node',
  [
    TreeNode<String>(ValueKey('child1'), 'Child 1'),
    TreeNode<String>(ValueKey('child2'), 'Child 2'),
  ],
  true, // initially expanded
);

Constructors

TreeNode(Key key, T data, [List<TreeNode<T>>? children, bool isExpanded = false])
Creates a tree node with the specified key, data, optional children, and initial expansion state.

Properties

children List<TreeNode<T>>
The child nodes of this node.
final
data → T
The data associated with this node.
final
hashCode int
The hash code for this object.
no setterinherited
isExpanded ValueNotifier<bool>
Gets the current expansion state of the node.
no setter
key Key
The unique key for this node.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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