ChangeNotifierProviderExtension extension

An extension on BuildContext that adds methods for retrieving Listenable objects from the nearest InheritedProvider ancestor widget.

on

Methods

of<T extends Listenable>({bool listen = false}) → T

Available on BuildContext, provided by the ChangeNotifierProviderExtension extension

Retrieves the Listenable object of type T from the nearest InheritedProvider ancestor widget.
watch<T extends Listenable>() → T

Available on BuildContext, provided by the ChangeNotifierProviderExtension extension

Retrieves the Listenable object of type T from the nearest InheritedProvider ancestor widget and rebuilds the widget tree when it changes.