Ephemeral versus app state

List of approaches

Simple app state management

Data & backend

State management

Simple app state management

Our example

Lifting state up

Accessing the state

ChangeNotifier

ChangeNotifierProvider

Consumer

Provider.of

Putting it all together

Now that you know about declarative UI programming
and the difference between ephemeral and app state,
you are ready to learn about simple app state management.

On this page, we are going to be using the provider package.
If you are new to Flutter and you don’t have a strong reason to choose
another approach (Redux, Rx, hooks, etc.), this is probably the approach
you should start with. The provider package is easy to understand
and it doesn’t use much code.
It also uses concepts that are applicable in every other approach.