TreeRootNode<T> constructor

TreeRootNode<T>({
  1. required List<TreeNode<T>> children,
})

Creates a TreeRootNode container with the specified children.

Constructs an invisible root node that serves as a container for multiple top-level tree items.

Parameters:

  • children (List<TreeNode<T>>, required): Child nodes to contain

Example:

TreeRootNode<String> root = TreeRootNode(
  children: [
    TreeItemNode(data: 'Item 1'),
    TreeItemNode(data: 'Item 2'),
    TreeItemNode(data: 'Item 3'),
  ],
);

Implementation

TreeRootNode({
  required this.children,
});