animated_tree_view icon indicating copy to clipboard operation
animated_tree_view copied to clipboard

Question: Is there a way to deactivate "toggleExpansion" ?

Open DasTobbel opened this issue 1 year ago • 2 comments

Hi, i'm looking for a way to, based on the item, to deactivate the expansion/collapse of its children. Is there a way currently ?

Or is it something you want to achieve? If yes, my suggestion would be something like, i could do the PR:

  Future<void> toggleExpansion(ITreeNode<Data> item) async {
    if (item.isExpandable == false) {
      return;
    }
    if (item.isExpanded)
      await collapseNode(item);
    else {
      expandNode(item);
      await applyExpansionBehavior(item);
    }
  }

Greets!

DasTobbel avatar Jul 11 '23 08:07 DasTobbel