fix: BlocBuilder doesn't receive state when emitted from async loop #4197
Labels
bug
Something isn't working
question
Further information is requested
waiting for response
Waiting for follow up
Description
Hi there, I'm facing this issue where the state (RefreshedContactCount) is emitted but for some reason not being received by the BlocBuilder. All the other states are received and updating the UI just fine but RefreshedContactCount. Here is the method in the cubit which emits the state:
And this is the BlocBuilder which is suppose to receive the state:
Expected Behavior
State gets received by the BlocBuilder or Consumer and updates the UI.
Additional Context
I have been using Bloc for years now and never faced this kind of issue, I'm guessing the loop might be causing the issue, causing some kind of race condition. I'd very much appreciate if someone could help or take a look. Thanks.
The text was updated successfully, but these errors were encountered: