ChangeNotifierProvider<T extends ChangeNotifier?> constructor
ChangeNotifierProvider<T extends ChangeNotifier?> ({
- Key? key,
- required Create<
T> create, - bool? lazy,
- TransitionBuilder? builder,
- 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,
);