What is the purpose of InheritedNotifier in Flutter?

Answer

InheritedNotifier combines InheritedWidget and Listenable. It is a generic InheritedWidget that automatically marks dependent widgets as dirty whenever the wrapped Listenable (like a ValueNotifier or AnimationController) calls its listeners. This means you get the efficiency of InheritedWidget (only rebuilds widgets that depend on it) combined with the simplicity of Listenable-based state. It is used internally by the Flutter framework and is the building block for creating custom, efficient state management solutions without relying on external packages.