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

Timer errors occur when leaving page with animation #46

Closed
brainlid opened this issue Dec 26, 2018 · 2 comments
Closed

Timer errors occur when leaving page with animation #46

brainlid opened this issue Dec 26, 2018 · 2 comments

Comments

@brainlid
Copy link

Describe the bug
Either document proper usage or enable a Spinkit animation to dispose it's own timer.

Timer errors occur when closing the page with the animation on it.

SpinKit name

SpinKitPouringHourglass

Description/Usage

I'm displaying the SpinKitPouringHourglass on a stateless page. The widget is used this way:

  Widget build(BuildContext context) {

    // ...

    List<Widget> displayList = [
      titleSection,
      Align(
        alignment: Alignment.center,
        child: SpinKitPouringHourglass(
          color: theme.primaryColor,
          size: 90.0,
        )
      ),
      instructionsSection,
    ];

    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Questionnaire'),
      ),
      body: new ListView(children: displayList),
    );
  }

The errors occur when I hit the "Back" button to pop the nav stack and return to the opening page.

Error Logs

I/flutter (20208): _SpinKitPouringHourglassState#3447a(ticker active) was disposed with an active Ticker.
I/flutter (20208): _SpinKitPouringHourglassState created a Ticker via its SingleTickerProviderStateMixin, but at the
I/flutter (20208): time dispose() was called on the mixin, that Ticker was still active. The Ticker must be disposed
I/flutter (20208): before calling super.dispose(). Tickers used by AnimationControllers should be disposed by calling
I/flutter (20208): dispose() on the AnimationController itself. Otherwise, the ticker will leak.
I/flutter (20208): The offending ticker was: Ticker(created by _SpinKitPouringHourglassState#3447a(lifecycle state:
I/flutter (20208): created))
@brainlid
Copy link
Author

I changed the SpinKit icon to the SpinKitPumpingHeart and SpinKitRotatignPlain and both worked correctly. No errors after popping the page.

jogboms added a commit that referenced this issue Dec 28, 2018
@jogboms
Copy link
Owner

jogboms commented Dec 28, 2018

@brainlid, sorry for the delays, holiday season here. This issue has been addressed and is coming up on the next release.

@jogboms jogboms mentioned this issue Dec 28, 2018
jogboms added a commit that referenced this issue Dec 28, 2018
* fix: state disposed before ticker

Fixes #46

* chore: handle analysis issues

* feat: duration parameter

Closes #43

* chore: code clean up

* chore: update changelog
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