registerInstance<S> method

void registerInstance<S>(
  1. S instance, {
  2. String? name,
})

Registers an instance into the container.

An instance of type S can be registered.

If name is set, the instance will be registered under this name. To retrieve the same instance, the same name should be provided to KiwiContainer.resolve.

Implementation

void registerInstance<S>(
  S instance, {
  String? name,
}) {
  _setProvider(name, _Provider<S>.instance(instance));
}