Service constructor

const Service({
  1. ServiceLifetime lifetime = ServiceLifetime.singleton,
  2. Type? exposeAs,
  3. List<Symbol> tags = const <Symbol>[],
})

Creates a new service. The lifetime describes, if the service should be stored in the service provider after it's instantiated (ServiceLifetime.singleton) or if always a fresh instance is created (ServiceLifetime.transient).

Implementation

const Service({
  this.lifetime = ServiceLifetime.singleton,
  this.exposeAs,
  this.tags = const <Symbol>[],
});