TreeView<T extends ListenableNode<T>> class Null safety



TreeView({Key? key, required LeveledItemWidgetBuilder<T> builder, ExpansionIndicator? expansionIndicator = ExpansionIndicator.RightUpChevron, ExpansionBehavior expansionBehavior = ExpansionBehavior.scrollToLastChild, TreeViewController<T>? controller, ListenableNode<T>? initialItem, AutoScrollController? scrollController, double? indentPadding, ValueSetter<T>? onItemTap, bool? primary, ScrollPhysics? physics, bool? shrinkWrap, EdgeInsetsGeometry? padding, bool? showRootNode})
The default TreeView uses a Node internally, which is based on the Map data structure for maintaining the children states. The Node does not allow insertion and removal of items at index positions. This allows for more efficient insertion and retrieval of items at child nodes, as child items can be readily accessed using the map keys.


builder LeveledItemWidgetBuilder<T>
The builder function that is provided to the item builder
controller TreeViewController<T>?
An optional controller that allows controlling the TreeView programmatically
expansionBehavior ExpansionBehavior
The ExpansionBehavior provides control over the behavior of the node when it is expanded.
expansionIndicator ExpansionIndicator?
expansionIndicator can be customized to provide any expansion widget and collapse widget. The pre-built available expansionIndicators are ** ExpansionIndicator.RightUpChevron ** ExpansionIndicator.PlusMinus ** ExpansionIndicator.DownUpChevron
hashCode int
The hash code for this object.
@nonVirtual, read-only, inherited
indentPadding double?
This is the padding is applied to the start of an item. indentPadding will be multiplied by INode.level before being applied. ** e.g. if the node level is 2 and indentPadding is 8, then the start padding applied to an item will be 2*8 = 16
initialItem ListenableNode<T>?
An optional initialItem that can allows to initialize the TreeView with initial data
key Key?
Controls how one widget replaces another widget in the tree.
final, inherited
onItemTap ValueSetter<T>?
An optional callback that can be used to handle any action when an item is tapped or clicked
padding EdgeInsetsGeometry?
The amount of space by which to inset the children.
physics ScrollPhysics?
An object that can be used to control the position to which this scroll view is scrolled.
primary bool?
Whether this is the primary scroll view associated with the parent PrimaryScrollController.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scrollController AutoScrollController?
An optional scrollController that provides more granular control over scrolling behavior
showRootNode bool?
Flag to show the Root Node in the TreeView. Root Node is always the first item in the TreeView. If it is set to false then the Root Node will not be displayed, rather the first child of the RootNode will be the first item in the TreeList
shrinkWrap bool?
Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed. This is passed directly to the AnimatedList's shrinkWrap attribute For more information see the AnimatedList.shrinkWrap


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


operator ==(Object other) bool
The equality operator.
@nonVirtual, inherited