Service constructor
const
Service({
- ServiceLifetime lifetime = ServiceLifetime.singleton,
- Type? exposeAs,
- 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>[],
});