Service class
This class represents a service that is registered in the ServiceProvider.
Constructors
-
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).
const
Properties
- exposeAs → Type?
-
An optional type how the service is exposed.
This is useful if you create an interface and want to expose
a concrete implementation with the type of a interface.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lifetime → ServiceLifetime
-
The lifetime of the service
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Tags for this service. Tags can be used to group services together and
receive all services in a specific groups from the ServiceProvider.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited