design_system/components/data/tree_models library

Classes

TreeNode<T>
The schema for a single node, generic over its value type T. This is the customisation surface: a host composes a List<TreeNode<T>> (each with its own children) to define the whole tree. Immutable — structural edits in the controller produce new node objects via copyWith, which makes undo/redo a cheap reference swap.
TreeOps
Static helpers shared by the controller and the view. Each is generic over the node value type T; the type argument is normally inferred from the List<TreeNode<T>> you pass in.
TreeRow<T>
One row produced by flattening the tree for the current expansion / filter state. Carries everything the view needs to paint a single line, including the ancestor "has a following sibling" flags used to draw the indent guide-lines (│ ├ └).

Enums

TreeCheck
Tri-state check status of a node (derived from its leaves).
TreeSelectionMode
What a Tree lets the user select via clicks / keyboard (independent of the checkbox layer, which is always available when showCheckboxes is on).

Typedefs

TreeNodeId = String
Stable identity of a node. Kept as a String so hosts can use their own keys (paths, uuids, db ids) without adapting.