TreeNode<T> constructor

TreeNode<T>({
  1. required String label,
  2. required T value,
  3. List<TreeNode<T>> children = const [],
  4. bool isExpanded = false,
})

Creates a new TreeNode with the specified label and value.

Implementation

TreeNode({
  required this.label,
  required this.value,
  this.children = const [],
  this.isExpanded = false,
}) {
  for (final child in children) {
    child.parent = this;
  }
}