ajomuch92/flutter-scrolling-fab-animated

setState() called after dispose()

Closed this issue · 1 comments

flutter: ══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════
flutter: The following assertion was thrown:
flutter: setState() called after dispose(): _ScrollingFabAnimatedState#ac8f4(lifecycle state: defunct, not
flutter: mounted)
flutter: This error happens if you call setState() on a State object for a widget that no longer appears in
flutter: the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
flutter: can occur when code calls setState() from a timer or an animation callback.
flutter: The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
flutter: callback. Another solution is to check the "mounted" property of this object before calling
flutter: setState() to ensure the object is still in the tree.
flutter: This error might indicate a memory leak if setState() is being called because another object is
flutter: retaining a reference to this State object after it has been removed from the tree. To avoid memory
flutter: leaks, consider breaking the reference to this object during dispose().

I get this exception in a widget with a RefreshIndicator. If the user do some consecutive pull refresh, the exception arises.

A new version was release with your fix @luis901101