
Like a shopping cart with its items or the status of being logged in. When mobile app projects gain a certain size, there is an increasingly high probability that screens (in Flutter: widgets) share data across the whole app.
#Flutter blocs software
Given the assumption that an architectural pattern like BLoC improves the long-term maintainability of software projects, what are the concrete problems it solves? State management Even worse: I have often made the experience that companies decided to rewrite everything because the effort of a huge refactoring would even exceed the effort of a complete rewrite. When a project has reached the point where it has become hardly maintainable, it is a huge load of work to transform it into a well structured project. In my opinion, it’s a good idea to go for the safe approach and cleanly design the architecture right from the beginning as it can save a lot of trouble later on. The problem is: once you start a project, you never know, how big it’s going to become eventually. At this point, a clean architecture will have paid off.
#Flutter blocs code
However, you will reach a point where the whole code becomes a mess in terms of testability, maintainability and probably also performance. At the beginning you can save quite some time if you go for a very simple approach without too many thoughts about the architecture. No for apps that need to be scalable, readable and maintainable and is worked on by more than one person. The above explanation might sound reasonable but also quite complicated for a problem that can be solved in totally simple ways, right? It was first mentioned by Google at the Google I/O in 2018 and has since then become the de facto standard for many developers when it comes to state management solutions in Flutter app development. It also aims for reusability of the same logic across multiple widgets.

Generally speaking, BLoC ( Business Logic Component) is a design pattern enabling developers to efficiently and conveniently manage state across their apps without a tight coupling between the presentation (view) and the logic.


During this article I want to clear things up. However, depending on their personal previous experience with Dart, Flutter, Streams and state management, it might be hard for beginners to wrap their head around it. It’s almost inevitable to come across the concept of or at least the term “BLoC” when you learn about Flutter and its recommended architecture approaches.
