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

Inheritance

Constructors

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.
const

Properties

builder LeveledItemWidgetBuilder<T>
The builder function that is provided to the item builder
final
controller TreeViewController<T>?
An optional controller that allows controlling the TreeView programmatically
final
expansionBehavior ExpansionBehavior
The ExpansionBehavior provides control over the behavior of the node when it is expanded.
final
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
final
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
final
initialItem ListenableNode<T>?
An optional initialItem that can allows to initialize the TreeView with initial data
final
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
final
padding EdgeInsetsGeometry?
The amount of space by which to inset the children.
final
physics ScrollPhysics?
An object that can be used to control the position to which this scroll view is scrolled.
final
primary bool?
Whether this is the primary scroll view associated with the parent PrimaryScrollController.
final
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
final
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
final
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
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.
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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}) 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.
@nonVirtual, inherited