ChangeNotifierProvider<T extends ChangeNotifier?> constructor

ChangeNotifierProvider<T extends ChangeNotifier?>(
  1. {Key? key,
  2. required Create<T> create,
  3. bool? lazy,
  4. TransitionBuilder? builder,
  5. Widget? child}
)

Creates a ChangeNotifier using create and automatically disposes it when ChangeNotifierProvider is removed from the widget tree.

create must not be null.

Implementation

ChangeNotifierProvider({
  Key? key,
  required Create<T> create,
  bool? lazy,
  TransitionBuilder? builder,
  Widget? child,
}) : super(
        key: key,
        create: create,
        dispose: _dispose,
        lazy: lazy,
        builder: builder,
        child: child,
      );