Great tutorial, thank you. But I got one question: I think it's neutral to provide multiple instances of same bloc/cubit. For example, what if I want to start a new counter on secondary page, which is totally irrelevant with the one at home page? Appreciate if you can replay.
This playlist is a Gold Mine. I am working on a startup where they are working on dart based backend framework and I am still in college learning stuff. This playlist is a saver for me. 🙏🙏
Because blocs expose streams, it may be tempting to make a bloc which listens to another bloc. You should not do this. it creates a dependency between two blocs. Generally, sibling dependencies between two entities in the same architectural layer should be avoided at all costs, as it creates tight-coupling which is hard to maintain. Since blocs reside in the business logic architectural layer, no bloc should know about any other bloc. A bloc should only receive information through events and from injected repositories (i.e., repositories given to the bloc in its constructor). If you’re in a situation where a bloc needs to respond to another bloc, you have two other options. You can push the problem up a layer (into the presentation layer), or down a layer (into the domain layer). - from the bloc documentation