The provider Package
Explore how to implement state management in Flutter apps with the provider package. Learn to separate UI and logic by using ChangeNotifier and ChangeNotifierProvider to update and consume app state reactively. Understand how to install the provider package and integrate it into your app to keep the UI synchronized with the underlying data changes.
Introduction to the provider package
The provider package uses InheritedWidget under the hood. It offers a simplified, low-boilerplate approach to state management. The provider package makes it easy to separate the UI and logic of an application.
Defining provider at the top of a widget tree makes the app state accessible to all child widgets.
The provider state can then be accessed down the widget tree
In this tutorial, we’ll update the state of the app below using provider: