TreeNode<T> constructor

TreeNode<T>(
  1. Key key,
  2. T data, [
  3. List<TreeNode<T>>? children,
  4. bool isExpanded = false,
])

Creates a tree node with the specified key, data, optional children, and initial expansion state.

Implementation

TreeNode(
  this.key,
  this.data, [
  List<TreeNode<T>>? children,
  bool isExpanded = false,
])  : children = children ?? <TreeNode<T>>[],
      _isExpanded = ValueNotifier(isExpanded);