tguerin / newton

An Easy To Use Particle Emitter
https://newton.7omtech.fr
MIT License
22 stars 7 forks source link

How to dispose properly the effect? #10

Closed manelfera closed 10 months ago

manelfera commented 10 months ago

Very good work on that package!

I am trying to use the package on the game template, replacing the confetti animation with the Fireworks from your package, but when navigating after the effect has started it throws errors because it's not disposed properly.


NewtonState 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.```
tguerin commented 10 months ago

Thanks for the feedback, the ticker was stopped after the super.onDispose causing the error. I'm releasing 0.1.3 right now to fix this. Let me know if you still have an issue. I'm also working on adding state callback to help you know when an effect is over.

tguerin commented 10 months ago

0.1.3 is up on pub.dev

manelfera commented 10 months ago

Amazing work and super fast! Thank you very much!!