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

Error in debug console when dragging item in long list #9

Closed
mivoligo opened this issue Oct 9, 2020 · 1 comment
Closed

Error in debug console when dragging item in long list #9

mivoligo opened this issue Oct 9, 2020 · 1 comment

Comments

@mivoligo
Copy link

mivoligo commented Oct 9, 2020

I've got this with BasicExample as well as with DragHandleExample. When list is longer than screen and I drag item from the top of the list to somewhere down, debug console is not happy:

════════ Exception caught by gesture library ═══════════════════════════════════
The following assertion was thrown while routing a pointer event:
setState() called after dispose(): _DragAndDropItemWrapper#6cf44(lifecycle state: defunct, not mounted, tickers: tracking 1 ticker)

This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.

The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
@philip-brink
Copy link
Owner

Hi @mivoligo, thanks! I've added a fix to this in v 0.2.4.

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