ProviderListener<T> constructor

  1. @Deprecated('Use WidgetRef.listen instead')
const ProviderListener<T>({
  1. Key? key,
  2. required OnProviderChange<T> onChange,
  3. required ProviderListenable<T>? provider,
  4. 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);