Bad state: Stream has already been listened to.
See original GitHub issueIssue: I am calling notification in xyz.dart page I have made initialization correctly though when the notification displayed and when I clicked on it does not open the desired page but instead of any button click on the page it listening to that time and I am getting this issue.
Bad state: Stream has already been listened to.
log:
`════════ Exception caught by widgets library ═══════════════════════════════════════════════════════ The following StateError was thrown, building Builder: Bad state: Stream has already been listened to.
The relevant error-causing widget was: MaterialApp file:///D:/code/xyz/lib/main.dart:60:12 When the exception was thrown, this was the stack: #3 _xyzState.initState (package:xyz.dart:136:47) #4 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4765:58) #5 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5) … Normal element mounting (132 frames) #137 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14) …`
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Related StackOverflow Question
@josaphatcampos Thank you very much for this wonderful, easy to use and less code package.
This your answer fixed my problem
try{ AwesomeNotifications().actionStream.listen((receivedNotification) {
Use inside of Statefull at initState. Its works for me.