Is it hard to change State Management Solution in Flutter?
Hello, my friends. In this article, I’m going to talk about my experience which is changing the state management solution in Flutter.
Everyone who wants to start with Flutter comes across the State Management topic. When the time comes, people have to decide on at least one of the State Management solutions.
I remember that I started with stateful widgets, which have the setState() method. Also, 2 years ago, there was some gossip about BloC, they said that the BloC most hard one for the State Management solution, also they suggested this library since after getting used to using it, you can easily use it. I was scared since they said that BloC is hard, but I overcame it. I learned how can I find a way around it. This is one example of course.
Until I understand and learn about BloC, I used cubits which is inside the BloC library. When the day came up, I decided to learn BloC, and I learnt it. After some time, and after I improved myself, the time was ready for me to search for a job. I have chosen the BloC, but I did not think about everyone can choose the other solutions. If you join a team that uses your State Management solution, then you can be lucky. But also If you use a different State Management solution from the others, it’s also okay I can say for you. Why? Let’s dive into more and more.
After understanding the State Management Topic, you can use all of them
This title is the summary of the State Management topic. Within time, you get used to using more and more State Management and it does not matter what you use. You learn how to manage the state with different methods. If you use Riverpod, then you need to learn providers. If you use BloC, you need to create BloCs and Cubits. Let’s say If you use getX, then you need to understand obs-RX things. The important thing is, sometimes you need to update screens according to state, and sometimes you do not need. So, you choose one of the State Management solutions from the libraries, and you apply it to this idea. For instance, If you use BloC, instead of getX, then instead of BlocBuilder, you can use the Obx property in getX. This is also one example to understand what I wrote.
The logic is the same.
Of course, I do not say all of them same, they have different properties, but If you almost get a job, and If you are in the decision part of this, then you should not forget you can change your solution temporarily. If your CTO wants you to change, since they use a different one, then you can change it, and learn it.
Be determined and willing to learn
Right now, I am working as a Flutter Developer at Voltran App which is a platform for education (for both students and teachers). I get used to using Riverpod, but they were using different Solutions for the managing state. So, the project was big, and I have known that I can just give a suggestion, we would not change it since it takes too much time. So I decided to learn the getX library and I almost learn. If I want to change my job, or If I want to create content for YouTube or Medium with my preferred State Management solution, then I can create it easily. You can think this is the same as If you are a student, then you use also Math in Physics. There is a loop in the State Management section. I strongly suggest that do not stick with only one of them. You should learn one of them strictly, but you should be also switchable.
That’s all for me. Feel free to ask any questions in the comments section. Also, you can glance at my open source applications which were created with different state management solutions from here. Finally, I strongly suggest you glance at the videos on my YouTube channel from here.
Thank you for reading, stay tuned!