The BLoC pattern relies on: StreamController . A StreamController exposes a StreamSink to inject data in the Stream and a Stream to listen to data, flowing inside the Stream. StreamBuilder. A StreamBuilder is a Widget which listens to a stream and rebuilds when new data is emitted by the Stream.6 Nis 2019
Read moreIs Bloc good for Flutter?
Bloc is a good pattern that will be suitable for almost all types of apps . It helps improve the code’s quality and makes handling states in the app much more manageable. It might be challenging for someone who is just beginning to use Flutter because it uses advanced techniques like Stream and Reactive Programming.
Read moreWhat is the difference between provider and Bloc in Flutter?
So here we can compare the StreamBuilder in Bloc with Consumer in Provider. The difference is that StreamBuilder listens to the stream and fetches the model on every change to rebuild the widget . But Consumer listens as soon as notifyListeners() executes inside the provider class.
Read moreHow does a Flutter bloc work?
How does it work? When you use flutter bloc you are going to create events to trigger the interactions with the app and then the bloc in charge is going to emit the requested data with a state , in a real example it will be like that: 1- User click on a button to get a list of games.
Read more