TreeView<T> constructor

TreeView<T>({
  1. Key? key,
  2. required List<TreeViewNode<T>> tree,
  3. TreeViewNodeBuilder<T> treeNodeBuilder = TreeView.defaultTreeNodeBuilder,
  4. TreeViewRowBuilder<T> treeRowBuilder = TreeView.defaultTreeRowBuilder,
  5. TreeViewController? controller,
  6. TreeViewNodeCallback<T>? onNodeToggle,
  7. AnimationStyle? toggleAnimationStyle,
  8. TreeViewIndentationType indentation = TreeViewIndentationType.standard,
  9. bool? primary,
  10. Axis mainAxis = Axis.vertical,
  11. ScrollableDetails verticalDetails = const ScrollableDetails.vertical(),
  12. ScrollableDetails horizontalDetails = const ScrollableDetails.horizontal(),
  13. double? cacheExtent,
  14. DiagonalDragBehavior diagonalDragBehavior = DiagonalDragBehavior.none,
  15. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  16. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  17. Clip clipBehavior = Clip.hardEdge,
  18. bool addAutomaticKeepAlives = true,
  19. bool addRepaintBoundaries = true,
})

Creates an instance of a TreeView for displaying TreeViewNodes that animate expanding and collapsing of nodes.

Implementation

TreeView({
  super.key,
  required this.tree,
  this.treeNodeBuilder = TreeView.defaultTreeNodeBuilder,
  this.treeRowBuilder = TreeView.defaultTreeRowBuilder,
  this.controller,
  this.onNodeToggle,
  this.toggleAnimationStyle,
  this.indentation = TreeViewIndentationType.standard,
  this.primary,
  this.mainAxis = Axis.vertical,
  this.verticalDetails = const ScrollableDetails.vertical(),
  this.horizontalDetails = const ScrollableDetails.horizontal(),
  this.cacheExtent,
  this.diagonalDragBehavior = DiagonalDragBehavior.none,
  this.dragStartBehavior = DragStartBehavior.start,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  this.clipBehavior = Clip.hardEdge,
  this.addAutomaticKeepAlives = true,
  this.addRepaintBoundaries = true,
}) : assert(verticalDetails.direction == AxisDirection.down &&
          horizontalDetails.direction == AxisDirection.right);