Skip to content

网路超时报错 #836

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

Closed
hanshengjian opened this issue Mar 26, 2023 · 0 comments
Closed

网路超时报错 #836

hanshengjian opened this issue Mar 26, 2023 · 0 comments

Comments

@hanshengjian
Copy link
Contributor

hanshengjian commented Mar 26, 2023

在趋势页面,选择一个语言的时候,网络超时,应该toast提示,但是遇到了报错,并且页面无提示,经过调试报错信息:
2023-03-26 13:35:46.217 32509-32559/com.shuyu.gsygithub.gsygithubappflutter I/flutter: Looking up a deactivated widget's ancestor is unsafe.
At this point the state of the widget's element tree is no longer stable.
To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
2023-03-26 13:35:46.219 32509-32559/com.shuyu.gsygithub.gsygithubappflutter I/flutter: #0 Element._debugCheckStateIsActiveForAncestorLookup. (package:flutter/src/widgets/framework.dart:4241:9)
#1 Element._debugCheckStateIsActiveForAncestorLookup (package:flutter/src/widgets/framework.dart:4255:6)
#2 Element.dependOnInheritedWidgetOfExactType (package:flutter/src/widgets/framework.dart:4275:12)
#3 Localizations.of (package:flutter/src/widgets/localizations.dart:472:48)
#4 GSYLocalizations.i18n (package:gsy_github_app_flutter/common/localization/default_localizations.dart:35:27)
#5 HttpErrorListener.errorHandleFunction (package:gsy_github_app_flutter/app.dart:188:36)
#6 HttpErrorListener.initState. (package:gsy_github_app_flutter/app.dart:155:7)
#7 _rootRunUnary (dart:async/zone.dart:1399:47)
#8 _CustomZone.runUnary (dart:async/zone.dart:1300:19)
#9 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1209:7)
#10 CastStreamSubscription._onData (dart:_internal/async_cast.dart:85:11)

调试时发现,调用errorHandleFunction时,HttpErrorListener._context的_lifiesycleState状态是_ElementLifecycle.defunct,并且绑定_widget=null,貌似Element被卸载了
无法贴图,_context的信息我截图了,需要的话可以提供

@CarGuo CarGuo closed this as completed in f501ce3 Mar 27, 2023
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

1 participant