flutter: The following assertion was thrown while finalizing the widget tree:
flutter: _WebViewPageState#e5d3e(ticker active) was disposed with an active Ticker.
flutter: _WebViewPageState created a Ticker via its SingleTickerProviderStateMixin, but at the time dispose()
flutter: was called on the mixin, that Ticker was still active. The Ticker must be disposed before calling
flutter: super.dispose(). Tickers used by AnimationControllers should be disposed by calling dispose() on the
flutter: AnimationController itself. Otherwise, the ticker will leak.
带有动画的页面关闭后,控制台报以上异常,经过排查发现_animationController.dispose()
的位置不对。_animationController.dispose()
的位置应该在super.dispose()
前执行。
void dispose() {
// TODO: implement dispose
_animationController.dispose();
super.dispose();
}