useNotifier<T extends ChangeNotifier> function

T useNotifier<T extends ChangeNotifier>(
  1. T notifier
)

Creates a ChangeNotifier.

The notifier is automatically disposed when the widget is unmounted.

Implementation

T useNotifier<T extends ChangeNotifier>(T notifier) {
  onBeforeUnmount(notifier.dispose);
  return notifier;
}