ExpandableTree<T> class Null safety

Creates a (recursive) menu tree-structure where each item is either a leaf node or a sub-menu containing another tree-structure of sub-nodes.

onSelect callBack of the selected node in the menu. nodes List of nodes at this level of the menu. closedTwisty Override Twisty Widget when node is collapsed. openTwisty Override Twisty Widget when node is expanded. nodeBuilder called to render the node itself from the node's data. openTwistyColor Color override to use when node is expanded. closedTwistyColor Override icon color when node is collapsed. twistyPosition Positioning of the Twisty to be placed before or after. (default) the node. submenuMargin EdgeInsets to add margins around expandable groups. submenuDecoration BoxDecoration to set background and borders on expandable groups. childrenMargin EdgeInsets used to add margins around children under expandable items. childrenDecoration BoxDecoration to set background and borders on children under expandable items.

Example: return ExpandableMenu

Inheritance

Constructors

ExpandableTree({Key? key, NodeSelectedCallback<T>? onSelect, Widget closedTwisty = DEFAULT_CLOSED_TWISTY, Widget openTwisty = DEFAULT_OPENED_TWISTY, required List<TreeNode<T>> nodes, required NodeBuilder<T> nodeBuilder, double childIndent = DEFAULT_CHILD_INDENT, bool initiallyExpanded = false, Color? openTwistyColor, Color? closedTwistyColor, TwistyPosition twistyPosition = DEFAULT_TWISTY_POSITION, BoxDecoration? childrenDecoration, BoxDecoration? submenuDecoration, EdgeInsets? submenuMargin, EdgeInsets? childrenMargin, Color? submenuClosedColor, Color? submenuOpenColor})
Default constructor. Used for the root as well as any sub-nodes that can be expanded to show children
const

Properties

childIndent double
final
childrenDecoration BoxDecoration?
final
childrenMargin EdgeInsets?
final
closedTwisty Widget
final
closedTwistyColor Color?
final
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
initiallyExpanded bool
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
nodeBuilder → NodeBuilder<T>
final
nodes List<TreeNode<T>>
final
onSelect → NodeSelectedCallback<T>?
final
openTwisty Widget
final
openTwistyColor Color?
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
final
final
final
final
twistyPosition TwistyPosition
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.
@protectedinherited
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.
@nonVirtualinherited