What is State Management?

Learn about state management in Flutter.

We'll cover the following

State management

All modern app developments require some kind of state management. The bigger the app is, the more sophisticated a state management solution is required to be. Previously, we discussed how stateful and stateless widgets function in Flutter. The most common way to update a state is to use stateful widgets and the setState function.

Usecase

When we build apps on the frontend, there are various states that keep changing because of user interactions. Some of them reside on a single page, like a radio button switch that is set to an on or off state. Some of these reside globally, like how the theme of the app can be switched from a light theme to a dark theme.

Flutter is a declarative language. Flutter’s user interface is designed to represent the current status of our program. When the state of our app changes, we modify the state, which causes the user interface to redraw.

There are various third-party packages out there that tackle this problem, each with a unique approach. We can find a list of third-party packages in Flutter’s documentation.

In our course, we’ll use the provider package to manage our app’s state.

Get hands-on with 1200+ tech skills courses.