KeyedServiceDescriptor class final
A ServiceDescriptor that also carries a key for keyed-service lookup.
Analogous to the keyed service extensions introduced in .NET 8.
- Inheritance
-
- Object
- ServiceDescriptor
- KeyedServiceDescriptor
Constructors
-
KeyedServiceDescriptor.asyncFactoryFn({required Type serviceType, required ServiceLifetime lifetime, required Object key, required Future<
Object> keyedAsyncFactory(Object provider, Object key)}) -
factory
- KeyedServiceDescriptor.factoryFn({required Type serviceType, required ServiceLifetime lifetime, required Object key, required Object keyedFactory(Object provider, Object key)})
-
factory
- KeyedServiceDescriptor.instanceValue({required Type serviceType, required Object instance, required Object key})
-
factory
- KeyedServiceDescriptor.type({required Type serviceType, required Type implementationType, required ServiceLifetime lifetime, required Object key})
-
factory
Properties
-
asyncFactory
→ Future<
Object> Function(Object provider)? -
An asynchronous factory that produces the service instance.
finalinherited
- factory → Object Function(Object provider)?
-
A synchronous factory that produces the service instance.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- implementationType → Type?
-
The concrete implementation type to instantiate, when constructor
injection is used.
finalinherited
- instance → Object?
-
A pre-built instance (only valid for ServiceLifetime.singleton).
finalinherited
- isAsyncFactoryRegistration → bool
-
no setterinherited
- isFactoryRegistration → bool
-
no setterinherited
- isInstanceRegistration → bool
-
no setterinherited
- isTypeRegistration → bool
-
no setterinherited
- key → Object
-
The key that disambiguates this registration from other registrations
of the same serviceType.
final
- lifetime → ServiceLifetime
-
The lifetime of the service.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceType → Type
-
The service type (abstract class / interface / concrete class).
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited