ProviderListener<T> constructor
- @Deprecated('Use WidgetRef.listen instead')
- Key? key,
- required OnProviderChange<
T> onChange, - required ProviderListenable<
T> ? provider, - required Widget child,
A widget that allows listening to a provider.
A common use-case is to use ProviderListener to push routes/modals/snackbars when the value of a provider changes.
Even if a provider changes many times in a quick succession, onChange will be called only once, at the end of the frame.
Implementation
@Deprecated('Use WidgetRef.listen instead')
const ProviderListener({
Key? key,
required this.onChange,
required this.provider,
required this.child,
}) : super(key: key);