provide<T extends Object> function

Provider<T> provide<T extends Object>(
  1. Object token, {
  2. Type? useClass,
  3. Object useValue = noValueProvided,
  4. Object? useExisting,
  5. Function? useFactory,
  6. List<Object>? deps,
})

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,
    );