provide<T extends Object> function
Short-hand for Provider(...)
.
It is strongly recommended to prefer the constructor, not this function,
and to use const Provider(...)
whenever possible to enable future
optimizations.
Implementation
Provider<T> provide<T extends Object>(
Object token, {
Type? useClass,
// TODO(b/156495978): Change to Object? and remove noValueProvided.
Object useValue = noValueProvided,
Object? useExisting,
Function? useFactory,
List<Object>? deps,
}) =>
Provider<T>(
token,
useClass: useClass,
useValue: useValue,
useExisting: useExisting,
useFactory: useFactory,
deps: deps,
);