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: The Ticker must be disposed before flutter: calling super.dispose #21

Closed
kojima1981 opened this issue Aug 11, 2022 · 0 comments · Fixed by #22
Closed

Error: The Ticker must be disposed before flutter: calling super.dispose #21

kojima1981 opened this issue Aug 11, 2022 · 0 comments · Fixed by #22

Comments

@kojima1981
Copy link

Describe the bug
I get the following error:

The following assertion was thrown while finalizing the widget tree:
_SidebarXState#9275a(ticker active) was disposed with an active Ticker.
_SidebarXState created a Ticker via its SingleTickerProviderStateMixin, but at the time dispose()
was called on the mixin, that Ticker was still active. The Ticker must be disposed before calling
super.dispose().
Tickers used by AnimationControllers should be disposed by calling dispose() on the
AnimationController itself. Otherwise, the ticker will leak.

Is it possible to fix it by changing the following:

class SidebarX extends StatefulWidget {

   /// Omit some code.... 

  @override
  void dispose() {
    _animationController.dispose();
    super.dispose();
  }
}
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

Successfully merging a pull request may close this issue.

1 participant