

They can throw an exception when something goes wrong. These classes don’t care about the UI or how the UI wants to display the data.

The Services folder will contain classes to make external calls, like calls to get photos.The Core folder will contain our classes, like the CatPhoto class.
FLUTTER PROVIDER HTTP REQUEST UPDATE
Let’s divide our model into 3 parts so that we can update it easily, and also so that it doesn’t depend on the UI of the app.
FLUTTER PROVIDER HTTP REQUEST CODE

When we call something from the UI in App logic (1), we’re usually calling a function as a result of interacting with a UI element, such as when we press a button. Usually, we create apps that have some UI screens, and app login is performed by making API calls and storing these results in databases. I am not saying that BLoC is inherently bad, but we should always remember the “You aren’t gonna need it” (YAGNI) principle that states that a programmer should not add functionality until it’s deemed necessary. BLoC pattern is not beginner friendly, and it requires a lot of boilerplate code. You don’t need state management techniques like BLoC or Redux to have a good long-term project. When you decide to start a long-term project on Flutter, the Provider approach seems too simple to be efficient.
