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

Bad state: Stream has already been listened to. #302

Open
function2000 opened this issue Dec 24, 2024 · 0 comments
Open

Bad state: Stream has already been listened to. #302

function2000 opened this issue Dec 24, 2024 · 0 comments

Comments

@function2000
Copy link

Describe the bug
Bad state: Stream has already been listened to.
The following StateError was thrown building AnimatedBuilder(listenable: AnimationController#e3f05(⏮ 0.000; paused), state: _AnimatedState#fa90d):

To Reproduce
Steps to reproduce the behavior:

I have a contact list, so initiate a control list:

void initChatControllers(int contactCounts){
int count = 0;
while(count < contactCounts) {
controllers.add(ChatController(
initialMessageList: Data.messageList,
scrollController: ScrollController(),
currentUser: ChatUser(
id: '1',
name: 'YSM',
profilePhoto: Data.profileImage,
),
otherUsers: [
ChatUser(
id: '2',
name: 'Simform',
profilePhoto: Data.profileImage,
),
]
));
count++;
}
update();
}

When I click one contact, I need to switch to another controller:

void updateFromUser(String user, int idx){
contact = user;
this.index = idx;
updateTopics();

chatController = controllers[idx];
update();

}

**There is no error when I switch to new controller. The error occurs when I switch to old one.

I also searched via google, a suggestion is to use broadcast. I expect to resolved inside this plugin.
Thanks!**

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