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

进入使用EasyRefresh的页面,然后快速返回上一页报错 #612

Closed
hujian1031 opened this issue Aug 30, 2022 · 2 comments
Closed

Comments

@hujian1031
Copy link

======== Exception caught by widgets library =======================================================
The following assertion was thrown while finalizing the widget tree:
_EasyRefreshState#5085c(tickers: tracking 2 tickers) was disposed with an active Ticker.

_EasyRefreshState created a Ticker via its TickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. All Tickers 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.

The offending ticker was: _WidgetTicker(created by _EasyRefreshState#5085c)
The stack trace when the _WidgetTicker was actually created was:
#0 new Ticker. (package:flutter/src/scheduler/ticker.dart:67:40)
#1 new Ticker (package:flutter/src/scheduler/ticker.dart:69:6)
#2 new _WidgetTicker (package:flutter/src/widgets/ticker_provider.dart:385:81)
#3 TickerProviderStateMixin.createTicker (package:flutter/src/widgets/ticker_provider.dart:295:34)
#4 new AnimationController.unbounded (package:flutter/src/animation/animation_controller.dart:279:21)
#5 IndicatorNotifier._initClampingAnimation (package:easy_refresh/src/notifier/indicator_notifier.dart:293:58)
#6 new IndicatorNotifier (package:easy_refresh/src/notifier/indicator_notifier.dart:44:5)
#7 new HeaderNotifier (package:easy_refresh/src/notifier/indicator_notifier.dart:779:8)
#8 _EasyRefreshState._initData (package:easy_refresh/src/easy_refresh.dart:327:23)
#9 _EasyRefreshState.initState (package:easy_refresh/src/easy_refresh.dart:287:5)
#10 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4942:57)
#11 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4781:5)
... Normal element mounting (45 frames)
#56 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#57 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6350:36)
#58 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6362:32)
... Normal element mounting (244 frames)
#302 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#303 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6350:36)
#304 Element.updateChild (package:flutter/src/widgets/framework.dart:3551:18)
#305 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5883:32)
#306 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6375:17)
#307 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#308 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)

@hujian1031
Copy link
Author

解决方法 easy_refresh.dart
@OverRide
void dispose() {
super.dispose();
_headerNotifier.dispose();
_footerNotifier.dispose();
_userOffsetNotifier.dispose();
}

替换成
@OverRide
void dispose() {
_headerNotifier.dispose();
_footerNotifier.dispose();
_userOffsetNotifier.dispose();
super.dispose();
}

@xuelongqy

@xuelongqy
Copy link
Owner

这个问题在最新版已解决

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