TreeItem<T> class final

An immutable item in an interactive TreeModel.

IDs must be unique across the complete tree. They are used to preserve selection and expansion state when TreeModel.replaceItems is called.

Constructors

TreeItem({required String id, required String label, required T value, List<TreeItem<T>> children = const [], String? icon, bool initiallyExpanded = true, bool selectable = true})
Creates a tree item.

Properties

children → List<TreeItem<T>>
Nested child items.
final
hasChildren → bool
Whether this item contains children.
no setter
hashCode → int
The hash code for this object.
no setterinherited
icon → String?
Optional icon rendered before label.
final
id → String
Stable identity for this item.
final
initiallyExpanded → bool
Initial expansion state when this item first enters a model.
final
label → String
Text shown for this item.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectable → bool
Whether keyboard and pointer selection may target this item.
final
value → T
Consumer-owned value associated with this item.
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