LayrzTreeView<T> class

A self-scrolling, box-form tree view with expand/collapse and optional multi-node selection.

LayrzTreeView is the easy-to-drop-in form: it wraps LayrzSliverTreeView in its own CustomScrollView, so it behaves like an ordinary ListView-ish widget and can be placed directly in a layout without the caller managing a surrounding scroll view. Use LayrzSliverTreeView instead when composing inside an existing CustomScrollView (e.g. one of LayrzScaffoldShell's panes) — the tree itself is implemented exactly once, in tree_sliver_view.dart; this widget adds no tree logic of its own.

Selection (independent or cascading — see LayrzTreeSelectionMode) and expansion (via LayrzTreeController) are both optional and both implemented in their own files, cleanly separable from this widget and from the SDK integration in tree_sliver_view.dart.

Inheritance

Constructors

LayrzTreeView({required List<LayrzTreeNode<T>> nodes, LayrzTreeNodeBuilder<T>? nodeBuilder, LayrzTreeController? controller, LayrzTreeSelectionController<T>? selectionController, bool selectable = false, void onSelectionChanged(Set<Object> selectedIds)?, EdgeInsetsGeometry? padding, Key? key})
Creates a LayrzTreeView.
const

Properties

controller LayrzTreeController?
Optional controller for programmatic expand/collapse and keyboard navigation.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
nodeBuilder LayrzTreeNodeBuilder<T>?
Builds the widget shown for each node's content. When null, a Text built from node.content.toString() is used.
final
nodes List<LayrzTreeNode<T>>
The root-level nodes of the tree. Nested nodes are supplied via each LayrzTreeNode.children.
final
onSelectionChanged → void Function(Set<Object> selectedIds)?
Called whenever the set of selected node ids changes, with the new set.
final
padding EdgeInsetsGeometry?
Padding applied around the scrollable tree content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectable bool
Whether nodes in this tree can be selected at all. Defaults to false.
final
selectionController LayrzTreeSelectionController<T>?
Optional controller for multi-node selection.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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