We have a Flutter application that uses websockets for server initiated communication. We use flutter_bloc as the state management mechanism across the app. UI events are conveyed to the widget through Bloc state transitions and BlocBuilder widgets.
An additional requirement is, there are some widgets should be re-rendered based on specific events received from the server over websocket.
StreamBuilder is a natural way to react to events received on the websocket. But was not sure about the best way to incorporate it in uI widgets that using Blocs.
Would appreciate inputs from the community on structuring code cleanly when Bloc and websocket channels are to be used together.