According to flutter documentation, a ChangeNotifierProvider:
Listens to a
ChangeNotifier, expose[s] it to its descendants and rebuilds dependents wheneverChangeNotifier.notifyListenersis called.
and I was wondering ... why does this class exist?
I mean, wouldn't a Provider<ChangeNotifier> suffice that allows each subscriber to the notifier to decide for themselves whether or not they want to rebuild when ChangeNotifier.notifyListeners is called?
My gut feeling is that it's somehow related to stateless widgets, but then if the stateless widget needs to update based on some state further up the widget tree, shouldn't a change in that state trigger a rebuild on a sub-tree of some stateful widget that contains the stateless widget?