Flutter: Simple state management with GetXnotionProjects

Author: Praweg Koirala

🗓️ February 17, 2023

⌛️ 2 mins

🌱 Seedling

🏷️    Flutter | state management | GetX


In this Blog we will cover basics of state management concept, brief introduction of GetX library and a step by step process of implementing the state management in a real time on a health tracking app .

So what is a State ? What is State Management? Why do we make big fuss abt it ?

What is a GetX Library? and why are people raving so much about it?

GetX is like a mini framework inside of Flutter. Among different feature and services it provides , one of the important and popular is its state management solution. It offers a simple state management, a reactive state management and a combo of both. Today, we will cover its simple state management approach.

Before we dive into details of state management approach we will be taking today. lets go through a brief intro on what a state management is and why is it important in any modern applications . A State in any application is like a hidden force that is not really visible to everyday users. What users see and experience is just the visual component obeying your orders. If you swipe in your app, you see a content is added or deleted. If you toggle a button you get to select and dis-select options . You can easily update things and change your UI in real time. You experience a true synchrony of all visual components that makes sense with the way you are interacting. You have a power of a conductor conducting an orchestra , bringing all the bells and whistles to jingle with just touch and swipe of a finger.

But under the hood it is not so much an orchestra , it is more a chaos and sometimes a jigsaw puzzle that needs to be connected in just the right way to create successful visual experience.

We are constantly updating UI & data with our interaction. To make sure all the changes stay upto date throughout your app . We need what is known as state management solution. All the changes in the states of ui and data needs to be updated through out the widget tree of our app. Sometimes the widget tree is just within one page and might be comparatively easy to pass the information. But anytime we have a bit more complex app with multiple pages, we are looking into passing that information around in multiple screen. Flutter does come with its own state management solution that can be used to maintain state called setState. It is a function that can take the information on the state ,within a stateful widget. But this is a least efficient way to manage state.

This post was last updated on: February 17, 2023

Back