在一个页面中调用了动画,
在页面关闭的时候dispose了动画,但是发现在页面关闭的时候,动画并没有关闭,
并且报 xx was disposed with an active Ticker 错误
-------------
后来发现原来是dispose调用的顺序问题
参考:https://github.com/Norbert515/pimp_my_button/issues/2
Calling super.dispose()
ahead of _controller.dispose()
caused this error in my project.
Swapping it so that _controller.dispose()
was called first fixed it:
@override void dispose() { _controller.dispose(); super.dispose(); }
super.dispose要最后调用