simple<Data> static method

TreeView<Data, TreeNode<Data>> simple<Data>({
  1. Key? key,
  2. required TreeNodeWidgetBuilder<TreeNode<Data>> builder,
  3. required TreeNode<Data> tree,
  4. ExpansionBehavior expansionBehavior = ExpansionBehavior.none,
  5. Indentation? indentation,
  6. AutoScrollController? scrollController,
  7. ExpansionIndicatorBuilder? expansionIndicatorBuilder,
  8. ValueSetter<TreeNode<Data>>? onItemTap,
  9. bool? primary,
  10. ScrollPhysics? physics,
  11. EdgeInsetsGeometry? padding,
  12. bool shrinkWrap = false,
  13. bool showRootNode = true,
  14. bool focusToNewNode = true,
  15. TreeReadyCallback<Data, TreeNode<Data>>? onTreeReady,
})

The default implementation of TreeView that uses a TreeNode internally, which is based on the Map data structure for maintaining the children states. The TreeNode 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.

The complexity for accessing child nodes in TreeView.simple is simply O(node_level). e.g. for path './.level1/level2', complexity is simply O(2).

** See code in example/lib/samples/treeview/treeview_modification_sample.dart **

See also:

Implementation

static TreeView<Data, TreeNode<Data>> simple<Data>({
  Key? key,
  required TreeNodeWidgetBuilder<TreeNode<Data>> builder,
  required final TreeNode<Data> tree,
  ExpansionBehavior expansionBehavior = ExpansionBehavior.none,
  Indentation? indentation,
  AutoScrollController? scrollController,
  ExpansionIndicatorBuilder? expansionIndicatorBuilder,
  ValueSetter<TreeNode<Data>>? onItemTap,
  bool? primary,
  ScrollPhysics? physics,
  EdgeInsetsGeometry? padding,
  bool shrinkWrap = false,
  bool showRootNode = true,
  bool focusToNewNode = true,
  TreeReadyCallback<Data, TreeNode<Data>>? onTreeReady,
}) =>
    TreeView._(
      key: key,
      builder: builder,
      tree: tree,
      expansionBehavior: expansionBehavior,
      indentation: indentation,
      expansionIndicatorBuilder:
          expansionIndicatorBuilder ?? _defExpansionIndicatorBuilder,
      scrollController: scrollController,
      onItemTap: onItemTap,
      primary: primary,
      physics: physics,
      padding: padding,
      shrinkWrap: shrinkWrap,
      showRootNode: showRootNode,
      onTreeReady: onTreeReady,
      focusToNewNode: focusToNewNode,
    );