TreeViewStateHelper<Data> constructor

TreeViewStateHelper<Data>({
  1. required AnimatedListStateController<Data> animatedListStateController,
  2. required TreeViewExpansionBehaviourController<Data> expansionBehaviourController,
  3. required ITreeNode<Data> tree,
  4. bool focusToNewNode = true,
})

Implementation

TreeViewStateHelper({
  required this.animatedListStateController,
  required this.expansionBehaviourController,
  required this.tree,
  this.focusToNewNode = true,
}) {
  _addedNodesSubscription = tree.addedNodes.listen(handleAddItemsEvent);
  _removeNodesSubscription = tree.removedNodes.listen(handleRemoveItemsEvent);

  try {
    _insertNodesSubscription =
        tree.insertedNodes.listen(handleInsertItemsEvent);
  } on ActionNotAllowedException catch (_) {}
}