Six things that can affect our blood sugar level.

When someone have diabetes regular check-up of blood sugar is Essential. This is because regular checks help us to know what is its effect and what we could do differently to stay in target range of…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




State Management in Flutter

Complete knowledge of what is going on in your flutter application saves up on brain strain when debugging or implementing new features. If the information in your application is scattered around, it may be mind-boggling to introduce features and fix bugs. When you see this, know that what you need is State Management 😎.

Complete control in your application you want, for you state management is.

What is not management 😎?

Management is not disorder. Management is not uncertainty.

Management is therefore control. For control to be achieved there has to be perfect knowledge of the transitions between states and the outcomes they lead to. Perfect knowledge means all the variables in the application have to be clearly stated and tracked, either from one point or from multiple points.

Hence State Management is a mechanism of controlling the state an application is in.

In flutter, one way of achieving state management is by passing the state down the widget tree, through the widgets constructors. Why is this a bad idea?

Passing the state down the widget tree is not an effective means of managing state especially for applications spanning multiple pages. This is because it scatters the information through multiple widgets and does not offer a unified pattern to update the state. This makes your job as a developer a living hell. The process of changing or adding to the existing code base because impossible especially if done by a different developer.

Although the state of the application appears to be a single item, it can be divided into simpler states each for each component. This allows for state management by two approaches:

Each approach has its own properties that make it valuable in different settings.

Single Source Of Truth

Component-Based

That’s all! In this article we discussed what state management is, its importance in application development in flutter and the approaches one can use to achieve state management. In the next article we will cover one particular state management approach using the Provider Architecture.

That’s all I have for now in this article. Thanks for reading and feel free to comment below your thoughts or any suggestions / feedback on this article.

Add a comment

Related posts:

5 FAMOUS ARCHITECTURAL STRUCTURES IN ABUJA

Buildings often times reflect a society’s prestige, tradition and development. They show how civilized a society is and they normally come with unique and interesting features that stands them out…

CLOUD ENGINEER IN 88 DAYS

I was planning to start early but couldn’t get up early due to tiredness from yesterday's work. So, finally, I thought to start by going through youtube videos for the general introductions to the…

I Lived for Five Months On A Cruise Ship

We boarded cruise ship “Ambition” in the Port of Glasgow on October 13th, 2022. At that time, almost 1200 Ukrainian refugees, fleeing the war, were using the ship as a temporary shelter. We came to…