📱 Flutter
Intermediate
What is ChangeNotifier in Flutter?
Answer
ChangeNotifier is a simple class from the Flutter foundation that provides a notification mechanism. You extend it in your state model class, and call notifyListeners() whenever the state changes. Widgets that are watching this notifier (via Provider's context.watch() or Consumer) will automatically rebuild. It is the backbone of Provider-based state management. For more scalable alternatives, Riverpod's NotifierProvider and BLoC are commonly used.
Previous
What is the dio package in Flutter?
Next
What is a Key in Flutter and when should you use it?