You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it'd be nice to show an optional widget on node expansion when node's children is empty.
Use case: I need to show a button to add child for the root node when the root node is expanded. I tried a hack of replacing the root node with a custom expandable widget, but this came at the expense of not been able to access the root node's properties.
The text was updated successfully, but these errors were encountered:
You could just build your expansion tiles like this:
AnimatedSize(
duration: _collapseAnimationDuration, //e.g. const Duration(milliseconds: 250) this should be the same duration as SliverAnimatedTree.duration
alignment:Alignment.topCenter,
child:Column(
children: [
ListTile(
onTap: (){
_treeController.toggleExpansion(entry.node);
},
title:Text('This is an expansion tile', style:Theme.of(context).textTheme.bodyMedium, maxLines:3),
),
if(entry.isExpanded && entry.node.children.isEmpty) Text('No items')
],
)
)
I think it'd be nice to show an optional widget on node expansion when node's children is empty.
Use case: I need to show a button to add child for the root node when the root node is expanded. I tried a hack of replacing the root node with a custom expandable widget, but this came at the expense of not been able to access the root node's properties.
The text was updated successfully, but these errors were encountered: