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

setState() caled after dispose() #125

Closed
ciriousjoker opened this issue Aug 3, 2022 · 1 comment
Closed

setState() caled after dispose() #125

ciriousjoker opened this issue Aug 3, 2022 · 1 comment

Comments

@ciriousjoker
Copy link

Full error:

I/flutter ( 9122): setState() called after dispose(): AnimatedPulseFocusLightState#a92bd(lifecycle state: defunct, not mounted, tickers: tracking 0 tickers)
I/flutter ( 9122): 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.
I/flutter ( 9122): 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.
I/flutter ( 9122): 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().
I/flutter ( 9122): #0 State.setState.
package:flutter/…/widgets/framework.dart:1073
I/flutter ( 9122): #1 State.setState
package:flutter/…/widgets/framework.dart:1108
I/flutter ( 9122): #2 AnimatedPulseFocusLightState._tapHandler
package:tutorial_coach_mark/…/widgets/animated_focus_light.dart:442
I/flutter ( 9122):

Steps to reproduce:

  • Open tutorial with a single step in it
  • Click next
  • When the exit animation is done, click on the highlighted area

Basically, only occurs with this specific timing, but I managed to reproduce it consistently with a couple of tries.

@RafaelBarbosatec
Copy link
Owner

Fix available in 1.2.4 version

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