The Consumer Widget: Application

Continue to learn about the consumer widget and how you can implement it in an actual application.

How to notify listeners?

We need the ChangeNotifierProvider widget that provides an instance of a ChangeNotifier to its descendants. It comes from the provider package.

Now our task becomes much more manageable. Because we place ChangeNotifierProvider at the top of all widgets, any descendant widget can access the state from it directly.

Get hands-on with 1200+ tech skills courses.