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

Example : A dismissed Slidable widget is still part of the tree. #23

Open
giorgio79 opened this issue Jun 14, 2023 · 4 comments
Open

Example : A dismissed Slidable widget is still part of the tree. #23

giorgio79 opened this issue Jun 14, 2023 · 4 comments

Comments

@giorgio79
Copy link

giorgio79 commented Jun 14, 2023

Hello,

Fixed the example so it works with the latest Flutter :)

I am noticing that the Slideable widget when dismissed emits a small error. Please see video. Any tips how to make this issue go away? :

dismissed.widget.still.part.of.the.tree.error.webm

(https://github.com/wwwdata/implicitly_animated_reorderable_list/assets/283347/ee9b58ed-46bf-42a1-92cd-abfbcbb67af7)

The recommended solution by Stackoverflow is to use UniqueKey instead of ValueKey https://stackoverflow.com/questions/55792521/how-to-fix-a-dismissed-dismissible-widget-is-still-part-of-the-tree-error-in

When switch to that, I am getting a small flicker in animation, as both Dismissible and AnimatedList is doing some animation.

double.animation.webm
======== Exception caught by widgets library =======================================================
The following assertion was thrown building SlidableDismissal(state: _SlidableDismissalState#c7a52(ticker inactive)):
A dismissed Slidable widget is still part of the tree.


Make sure to implement the onDismissed handle of the ActionPane and to immediately remove the Slidable widget from the application once that handler has fired.

@giorgio79
Copy link
Author

Stackoverflow to the rescue!!!!
https://stackoverflow.com/questions/45919197/flutter-dismissible-insists-list-item-must-be-removed-from-tree
need to use confirmDismiss instead of onDismiss...

Testing the proposal right now

@giorgio79
Copy link
Author

Still not perfect, but this one hopefully flutter/flutter#29844

@wwwdata
Copy link
Owner

wwwdata commented Jun 15, 2023

So what about the suggestion to set removeDuration to zero and work with this confirmDismiss callback?

@giorgio79
Copy link
Author

Yes, tried that. For some reason I still see the flicker in the Implicitly Animated widget. I tested going back to simple AnimatedList and no flicker there. Probably gonna go with AnimatedList for now.

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

2 participants