Choosing the correct Flutter design pattern

I think that BLoC pattern developed by Felix Angelov. it has many examples that can help you and it's very simple to use and recommended from flutter here is the link https://github.com/felangel/bloc


You need to use stateManagement.

It exist BLoC but you can also use Provider with no problem and it will solve your problem.

this is something wrote by Diego Velasquez about Widget Communication and could solve your problems.

But if you need more info i will let you something from Karthik Ponnam about State Management with Provider.

This will help you to understand a little more what state management is from the Flutter Docs


As you know a StatefulWidget is used whenever we have data that is going to change over time and when it does we want the UI to update. A StatefulWidget can update data and what not and screen re-renders, but the problem with it is that it does not scale up to larger applications that have multiple different screens.

With a StatefulWidget, it's challenging to pass data from one screen to another inside an application. StatefulWidget is more of a beginner way to show how to pass state in a flutter application.

For production level applications, there is the BLOC pattern which is another way of managing state inside a flutter application. There are other ways, but the BLOC pattern is highly recommended by the Flutter team. They believe it's the best way of doing things. To be clear, no one has the expertise to tell you which way to do it, but again, the Flutter team has publicly endorsed the BLOC pattern and for me that would mean good support if you get into trouble because it is challenging to understand.