TreeView class
A widget used to render a treeview in the ui, based on the state of this tree inside the controller.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TreeView
Constructors
-
TreeView({Key? key, required TreeController controller, required Widget nodeBuilder(BuildContext context, TreeNode<
Object?> node), Widget indicator = const DefaultIndicator(height: 15), Widget indicatorBuilder(BuildContext context, TreeNode<Object?> referenceNode, Placement intendedPlacement)?, bool allowPlacement(TreeNode<Object?> referenceNode, Placement intendedPlacement)?, double childExtent = 8.0, double spacing = 8.0, Duration? animationDuration, DragStartMode dragStartMode = DragStartMode.tap}) -
A widget used to render a treeview in the ui, based on the state of this tree inside the controller.
const
Properties
-
allowPlacement
→ bool Function(TreeNode<
Object?> referenceNode, Placement intendedPlacement)? -
Wether or not the user is allowed to place the node at the intended placement with reference to the passed node.
final
- animationDuration → Duration?
-
The duration of the collapse and expand animations.
final
- childExtent → double
-
The indent each child node has with respect to its parent.
final
- controller → TreeController
-
The controller this widget should use to build its contents.
final
- dragStartMode → DragStartMode
-
Defines how drag interactions should be initiated for nodes in this tree.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- indicator → Widget
-
The indicator that is visible when a node is being dragged
and shows where the widget would be placed if it would be dropped.
To make an indicator that depends on the position it is in take a look at the indicatorBuilder property
final
-
indicatorBuilder
→ Widget Function(BuildContext context, TreeNode<
Object?> referenceNode, Placement intendedPlacement)? -
A builder that can be used to create indicators that depend on the node the dragged node will be placed under.
If no builder is provided the regular indicator property will be used.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
nodeBuilder
→ Widget Function(BuildContext context, TreeNode<
Object?> node) -
The builder used to build each node.
Provides the context and the node being built, use the methods available on node to interact with it.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double
-
The amount of space between nodes.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< TreeView> -
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, 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