Provider<T extends Object>.factory constructor
Provide a value to all descendants.
The value created on first access by calling factory
.
The disposer
will called when State of Provider is removed from the tree permanently (State.dispose called).
Implementation
factory Provider.factory(
T Function(BuildContext) factory, {
Key? key,
void Function(T)? disposer,
Widget? child,
}) {
assert(factory != null);
return _FactoryProvider<T>(
key: key,
factory: factory,
disposer: disposer,
child: child,
);
}