ProviderExtension extension

Context extensions to easily retrieve state managers from the widget tree.

These extensions work seamlessly with both custom class controllers extending MinNotifier and standard Flutter ChangeNotifier classes.

on

Methods

read<T extends ChangeNotifier>({String? tag}) → T

Available on BuildContext, provided by the ProviderExtension extension

Obtains a state notifier of type T from the nearest ancestor without registering a dependency or triggering widget rebuilds.
watch<T extends ChangeNotifier>({String? tag}) → T

Available on BuildContext, provided by the ProviderExtension extension

Obtains a state notifier of type T from the nearest ancestor and registers this BuildContext to be dependent on it.