TreeView<T> class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TreeView
Constructors
-
TreeView({Key? key, TreeViewController<
T> ? controller, ScrollController? scrollController, ValueChanged<Key> ? onNodeTap, void onNodeSecondaryTapUp(Key, TapUpDetails)?, void onNodeExpansionChanged(Key, bool)?, EdgeInsets? padding = EdgeInsets.zero, ScrollPhysics? physics, double? iconSize = 12, bool allowParentSelect = false, bool supportParentDoubleTap = false, bool shrinkWrap = false, TreeViewTheme? theme = const TreeViewTheme.fallback(), bool primary = true, double indent = 20, Widget nodeBuilder(BuildContext, Node<T> )?, Widget empty = const SizedBox.shrink()})
Properties
- allowParentSelect → bool
-
Determines whether the user can select a parent node. If false,
tapping the parent will expand or collapse the node. If true, the node
will be selected and the use has to use the expander to expand or
collapse the node.
final
-
controller
↔ TreeViewController<
T> -
The controller for the TreeView. It manages the data and selected key.
latefinal
- empty → Widget
-
Specifies the empty placeholder widget to render if the tree is currently empty.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconSize → double?
-
The size of Node expander icon.
final
- indent → double
-
Indention size.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
nodeBuilder
→ (Widget Function(BuildContext, Node<
T> )?) -
Custom builder for nodes. Parameters are the build context and tree node.
final
- onNodeExpansionChanged → (void Function(Key, bool)?)
-
The expand/collapse handler for a node. Passes the node key and the
expansion state.
final
- onNodeSecondaryTapUp → (void Function(Key, TapUpDetails)?)
-
The double tap handler for a node. Passes the node key.
final
-
onNodeTap
→ ValueChanged<
Key> ? -
The tap handler for a node. Passes the node key.
final
- padding → EdgeInsets?
-
The padding of the widget.
final
- physics → ScrollPhysics?
-
How the TreeView should respond to user input.
final
- primary → bool
-
Whether the TreeView is the primary scroll widget associated with the
parent PrimaryScrollController..
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
The scroll controller for TreeView widget.
final
- shrinkWrap → bool
-
Whether the extent of the TreeView should be determined by the contents
being viewed.
final
- supportParentDoubleTap → bool
-
Determines whether the parent node can receive a double tap. This is
useful if allowParentSelect is true. This allows the user to double tap
the parent node to expand or collapse the parent when allowParentSelect
is true.
IMPORTANT
When true, the tap handler is delayed. This is because the double tap
action requires a short delay to determine whether the user is attempting
a single or double tap.
final
- theme → TreeViewTheme?
-
The theme for TreeView.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< TreeView< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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}) → 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
Static Methods
-
of<
T> (BuildContext context, {bool build = true}) → TreeViewState< T>