Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.9k views
in Technique[技术] by (71.8m points)

'package:flutter/src/widgets/framework.dart': Failed assertion: line 5098 pos 14: '_dependents.isEmpty': is not true

so i make like a news details page with a comment stream section using node api and provider package and a related news section the problem begin when i try to navigate to another article from the related news section it gave me a an erorr "Bad state: Stream has already been listened to." and when i try to go back it gave the other error

I/flutter (25146): notsorted

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): comment updated sucssefuly from api
I/flutter (25146): loadcomments updated from provider

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): comment updated sucssefuly from api
I/flutter (25146): loadcomments updated from provider

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): notsorted

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): from comment newsdetails
I/flutter (25146): notsorted

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): notsorted

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): comment updated sucssefuly from api
I/flutter (25146): loadcomments updated from provider

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): comment updated sucssefuly from api
I/flutter (25146): loadcomments updated from provider

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): comment updated sucssefuly from api
I/flutter (25146): loadcomments updated from provider

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
'package:flutter/src/widgets/framework.dart': Failed assertion: line 5098 pos 14: '_dependents.isEmpty': is not true.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mMaterialApp[39;49m
 libmain.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): live match stayus code 200
I/flutter (25146): {"success":false,"msg":"?? ???? ???????? ???? !!!"}
I/flutter (25146): FavLive send from api sucssefuly

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Bad state: Stream has already been listened to.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mCommentstream[39;49m
 libscreens
ewsdetails.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): livegames updated from provider

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
'package:flutter/src/widgets/framework.dart': Failed assertion: line 5098 pos 14: '_dependents.isEmpty': is not true.
[38;5;244mThe relevant error-causing widget was[39;49m
[38;5;248mMaterialApp[39;49m
 libmain.dart
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): trend api activated
I/flutter (25146): news api activated
I/flutter (25146): 9
I/flutter (25146): notsorted
I/chatty  (25146): uid=10459(com.gulfgoal.gulf_goal) 1.ui identical 9 lines
I/flutter (25146): notsorted
I/flutter (25146): 25
I/flutter (25146): notsorted

[38;5;248m════════ Exception caught by scheduler library ═════════════════════════════════[39;49m
Tried to build dirty widget in the wrong build scope.
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Duplicate GlobalKeys detected in widget tree.
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): trend api activated
I/flutter (25146): news api activated
I/flutter (25146): 9
I/flutter (25146): notsorted
I/chatty  (25146): uid=10459(com.gulfgoal.gulf_goal) 1.ui identical 9 lines
I/flutter (25146): notsorted
I/flutter (25146): 25
I/flutter (25146): notsorted

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
Duplicate GlobalKeys detected in widget tree.
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
I/flutter (25146): from comment newsdetails
E/flutter (25146): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
E/flutter (25146): At this point the state of the widget's element tree is no longer stable.
E/flutter (25146): 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.
[38;5;244mE/flutter (25146): #0      Element._debugCheckStateIsActiveForAncestorLookup.<anonymous closure>[39;49m
 package:flutter/…/widgets/framework.dart
[38;5;244mE/flutter (25146): #1      Element._debugCheckStateIsActiveForAncestorLookup[39;49m
 package:flutter/…/widgets/framework.dart
[38;5;244mE/flutter (25146): #2      Element.getElementForInheritedWidgetOfExactType[39;49m
 package:flutter/…/widgets/framework.dart
[38;5;244mE/flutter (25146): #3      Provider._inheritedElementOf[39;49m
 package:provider/src/provider.dart
[38;5;244mE/flutter (25146): #4      Provider.of[39;49m
 package:provider/src/provider.dart
[38;5;248mE/flutter (25146): #5      _CommentstreamState.isstrem.<anonymous closure>[39;49m
 package:gulfgoal/components/commentstream.dart
[38;5;244mE/flutter (25146): #6      State.setState[39;49m
 package:flutter/…/widgets/framework.dart
[38;5;248mE/flutter (25146): #7      _CommentstreamState.isstrem[39;49m
 package:gulfgoal/components/commentstream.dart
[38;5;248mE/flutter (25146): #8      _CommentstreamState.initState.<anonymous closure>[39;49m
 package:gulfgoal/components/commentstream.dart
[38;5;244mE/flutter (25146): #9      _rootRunUnary (dart:async/zone.dart:1198:47)[39;49m
[38;5;244mE/flutter (25146): #10     _CustomZone.runUnary (dart:async/zone.dart:1100:19)[39;49m
[38;5;244mE/flutter (25146): #11     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)[39;49m
[38;5;244mE/flutter (25146): #12     _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1042:26)[39;49m
[38;5;244mE/flutter (25146): #13     _rootRunUnary (dart:async/zone.dart:1206:13)[39;49m
[38;5;244mE/flutter (25146): #14     _CustomZone.runUnary (dart:async/zone.dart:1100:19)[39;49m
[38;5;244mE/flutter (25146): #15     _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:1026:26)[39;49m
[38;5;244mE/flutter (25146): #16     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)[39;49m
[38;5;244mE/flutter (25146): #17     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)[39;49m
[38;5;244mE/flutter (25146): #18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)[39;49m
E/flutter (25146):
I/flutter (25146): 200
I/flutter (25146): 9
I/flutter (25146): notsorted
I/chatty  (25146): uid=10459(com.gulfgoal.gulf_goal) 1.ui identical 9 lines
I/flutter (25146): notsorted
I/flutter (25146): 25
I/flutter (25146): notsorted
I/fl

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

A hot restart might fix this '_dependents.isEmpty' error. If it wasn't resolved, you gotta post the code of the Stream you're listening to.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...