TreeController<T > class
Methods
activateFocused ()
→ TreeNode <T > ?
Toggle / activate the focused row: folders expand, leaves select.
Returns the activated leaf node (for the host to open), or null.
addChild (TreeNodeId parentId , {String label = 'New item' , bool folder = false , T? value })
→ TreeNodeId
Append a new child under parentId, expand it, select & begin renaming
the new node. Returns the new node's id.
addListener (VoidCallback listener )
→ void
Register a closure to be called when the object changes.
inherited
addSibling (TreeNodeId id , {String label = 'New item' , T? value })
→ TreeNodeId
Insert a sibling immediately after id (or append at root if id has
no parent and isn't found nested). Returns the new node's id.
beginEdit (TreeNodeId id )
→ void
cancelEdit ()
→ void
checkState (TreeNode <T > n )
→ TreeCheck
clearSelection ()
→ void
Clear the click/keyboard selection (leaves checkboxes alone).
collapse (TreeNodeId id )
→ void
collapseAll ()
→ void
commitEdit (TreeNodeId id , String label )
→ void
Commit an inline rename. Empty / unchanged labels just close the editor.
dispose ()
→ void
Discards any resources used by the object.
inherited
duplicate (TreeNodeId id )
→ TreeNodeId ?
Duplicate id (with a fresh id subtree) as the next sibling.
expand (TreeNodeId id )
→ void
expandAll ()
→ void
focus (TreeNodeId id )
→ void
focusFirst ()
→ void
focusInto ()
→ void
→ key: expand a collapsed folder, else step into the first child.
focusLast ()
→ void
focusOut ()
→ void
← key: collapse an expanded folder, else step out to the parent.
isExpanded (TreeNodeId id )
→ bool
isSelected (TreeNodeId id )
→ bool
moveFocus (int delta )
→ void
Move the keyboard cursor by delta rows through the visible list.
node (TreeNodeId id )
→ TreeNode <T > ?
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners ()
→ void
Call all the registered listeners.
inherited
redo ()
→ void
remove (TreeNodeId id )
→ void
Remove id and everything beneath it.
removeListener (VoidCallback listener )
→ void
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
removeSelected ()
→ int
Remove every node in the current multi-selection (and their subtrees), as
a single undoable step. Ancestors are dropped from the work-list so a
parent + child selected together don't double-remove. Returns the count.
replaceRoots (List <TreeNode <T > > roots )
→ void
Replace the whole forest (resets history). For host-driven reloads.
revealNode (TreeNodeId id )
→ void
Expand only the node and its ancestors so a deep node is revealed.
select (TreeNodeId id )
→ void
selectAllVisible ()
→ void
Select every selectable, currently-visible node (multi mode).
selectWith (TreeNodeId id , {bool toggle = false , bool range = false })
→ void
Pointer/keyboard selection honouring modifier keys and selectionMode :
• plain → select only id (resets the set)
• toggle → Ctrl/⌘-click: add/remove id, keep the rest (multi only)
• range → Shift-click: select the contiguous visible range from the
anchor to id (multi only)
Falls back to single behaviour when selectionMode isn't multi.
setChecked (Iterable <TreeNodeId > ids )
→ void
setQuery (String q )
→ void
toggle (TreeNodeId id )
→ void
toggleCheck (TreeNodeId id )
→ void
Toggle a node's check: cascades to every leaf beneath it (a lone leaf
toggles itself). Pure state — not part of structural undo history.
toString ()
→ String
A string representation of this object.
inherited
undo ()
→ void
valueOf (TreeNodeId id )
→ T?
The strongly-typed value behind id, or null.
visibleRows ()
→ List <TreeRow <T > >
The visible rows in render order. While searching, only matches and
their ancestors are shown, and ancestor folders are force-expanded so
the hits are revealed.
geniuslink_design_system 2.8.1