ChangeNotifier là class đơn giản thông báo listener khi state thay đổi thông qua notifyListeners(). extend ChangeNotifier để tạo đối tượng observable.
- Provider theo dõi
ChangeNotifiervà rebuild khinotifyListeners()được gọi. - Nó nhẹ nhưng cần quản lý thông báo thủ công.
- Cho state đơn giản (theme, auth, user data),
ChangeNotifierthường đủ dùng.
ChangeNotifier notifies listeners when state changes via notifyListeners().
- Extend it to create observable objects that Provider can watch and rebuild widgets accordingly.
- It's lightweight but requires manual notification management.