-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order issue when add a new node #33
Comments
I have a similiar behaivor. Starting data
When i update the tree (add Folder B to Folder 1) and Folder A is expanded the visible result is:
When i update the tree (add Folder B to Folder 1) and Folder A is collapsed the result is ok:
If the starting data has already an existing second folder and i add a third folder the result is also ok.
|
Using overridden class MyTreeNode extends TreeNode<MyTreeData> {
factory MyTreeNode.root({MyTreeData? data}) => MyTreeNode._your_own_factory(
key: INode.ROOT_KEY,
data: data,
// TODO(user): stuffs
)
..isLastChild = true
..cacheChildIndices();
} |
Also has the same problem |
...
Widget buildInsertBelowButton(IndexedTreeNode item) {
return Padding(
padding: const EdgeInsets.only(right: 16.0),
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: Colors.green[800],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(4)),
),
),
child: Text("Insert Below", style: TextStyle(color: Colors.green)),
onPressed: () {
_controller?.collapseNode(item); // My solution.
item.parent?.insertAfter(item, IndexedTreeNode());
},
),
);
}
... In my case, my solution is to just add collapseNode for the current node in the insertBelowButton widget's onPressed method. |
… the wrong index when the parent is expanded and has children
…at the wrong index when the parent is expanded and has children
Package version - 2.1.0
Type of tree - TreeView.simpleTyped
Flutter version - 3.13.6
There is an order issue when I add a node to a parent node where there are already expanded nodes, a new nodes is added to the wrong place
Screen.Recording.2023-11-13.at.10.37.03.mov
The text was updated successfully, but these errors were encountered: