Provider for State Management

Learn why the provider package is recommended for state management and how you can use it effectively.

Why use Provider?

Why is the Provider package recommended for state management?

First, let’s recall what we’ve learned about state so far.

When an app is running, sometimes we want something, such as the user’s log-in session or added item in the cart, to exist in memory.

If we want something to exist in memory, we can call that thing state.

We have already discussed state at various levels in previous lessons and also learned a few tricks to manage it.

Asking questions

However, that was just an introduction. We need to understand the concept of state in detail because it is imperative to build any complex app that handles multiple screens, different variables, user sessions, etc.

A state can include the app’s assets, variables (that the Flutter framework keeps about the UI), user sessions from different app parts, etc.

Whenever we design an app and start building it, we don’t have to manage every state.

The Flutter framework takes care of large sections, like textures. Despite that, we need some data to rebuild our UI ...

Get hands-on with 1400+ tech skills courses.