Skip to content
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

Possible bug? #27

Open
busslina opened this issue Oct 12, 2023 · 6 comments
Open

Possible bug? #27

busslina opened this issue Oct 12, 2023 · 6 comments

Comments

@busslina
Copy link

tree-error.webm
@jawwad-hassan89
Copy link
Collaborator

Is this related to this PR-28?
I will look into this.

@busslina
Copy link
Author

Is this related to this PR-28? I will look into this.

Not really. The thing here is that when I switch tabs, state get disposed. When re-enter on the tree tab I tried to reuse the Tree object. The root node is okay (gets reset to collapsed, but the remaining nodes that were previously get expanded, now are collapsed but its state say are expanded (you can see the ChevronIndicator), so I must click twice on it to get well expanded.

I bypass this bug(?) by creating my own paralel Tree which save the expanded state and the children values. So when I re-enter on the Tree tab, I create a new Tree (your Tree) and re-install the state saved on my tree.

@StoneColdRepins
Copy link

@busslina can you elaborate on your solution to bypass the bug(?) or post a code sippet

@busslina
Copy link
Author

busslina commented Nov 1, 2023

I just simply have a parallel tree in which I save the state. When I revisit this tab, I recreate the node states based on this parallel tree.

Seems that your node implementation is not prepared for a scenario where the page/container gets disposed and rebuilt again. They save the expanded state. But when they get recreated, they are not expanded but still have the expanded state.

I could pass my code, but it is just a patch. I recommend you to review your code and when the tree is re/build check the nodes and expand them if they are marked as exoanded

@StoneColdRepins
Copy link

hi please send the patch, i am new to flutter and using the control in my app

@busslina
Copy link
Author

busslina commented Nov 2, 2023

hi please send the patch, i am new to flutter and using the control in my app

https://gist.github.com/busslina/e60a41ceca418151c491a730f12a57b0

If you want help to understand my code, ask me in the Gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants