DependencyConfig class

Configuration for a dependency extracted from annotations and elements.

This class holds all the information needed to generate registration code for a single injectable dependency.

Constructors

DependencyConfig({required ImportableType type, required ImportableType typeImpl, int injectableType = InjectableType.factory, List<InjectedDependency> dependencies = const [], String? instanceName, bool? signalsReady, List<String> environments = const [], String constructorName = '', bool isAsync = false, List<ImportableType> dependsOn = const [], bool preResolve = false, bool canBeConst = false, ModuleConfig? moduleConfig, DisposeFunctionConfig? disposeFunction, int orderPosition = 0, String? scope, bool postConstructReturnsSelf = false, String? postConstruct, bool cache = false})
Creates a DependencyConfig with the given parameters.
DependencyConfig.factory(String type, {String? typeImpl, List<String> deps = const [], List<String> envs = const [], int order = 0, bool cache = false})
Creates a factory-type DependencyConfig for testing purposes.
factory
DependencyConfig.fromJson(Map json)
Creates a DependencyConfig from a JSON map.
factory
DependencyConfig.singleton(String type, {String? typeImpl, List<String> deps = const [], List<String> envs = const [], int order = 0, bool lazy = false})
Creates a singleton-type DependencyConfig for testing purposes.
factory

Properties

cache → bool
Whether this factory's result should be cached.
final
canBeConst → bool
Whether this dependency can be created as a const expression.
final
constructorName → String
The named constructor to use, or empty string for default.
final
dependencies → List<InjectedDependency>
The dependencies required by this dependency's constructor.
final
dependsOn → List<ImportableType>
Types that this singleton depends on for readiness signaling.
final
disposeFunction → DisposeFunctionConfig?
Configuration for the dispose function, if any.
final
environments → List<String>
The environment keys this dependency is registered for.
final
hashCode → int
The hash code for this object.
no setteroverride
identityHash → int
Returns a hash code based on fields that identify this dependency uniquely.
latefinal
injectableType → int
The registration type (factory, singleton, or lazy singleton).
final
instanceName → String?
The named instance identifier, or null for default registration.
final
isAsync → bool
Whether this dependency is registered asynchronously.
final
isFromModule → bool
Whether this dependency comes from a module.
no setter
moduleConfig → ModuleConfig?
Configuration for the module this dependency comes from, if any.
final
namedDependencies → List<InjectedDependency>
Returns named dependencies (named parameters).
no setter
orderPosition → int
The order position for registration sorting.
final
positionalDependencies → List<InjectedDependency>
Returns positional dependencies (non-named parameters).
no setter
postConstruct → String?
The name of a post-construct method to call after instantiation.
final
postConstructReturnsSelf → bool
Whether the post-construct method returns the instance itself.
final
preResolve → bool
Whether to pre-resolve this dependency at initialization time.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scope → String?
The scope this dependency belongs to, or null for root scope.
final
signalsReady → bool?
Whether this singleton signals when it's ready.
final
type → ImportableType
The abstract type that this dependency is registered as.
final
typeImpl → ImportableType
The concrete implementation type.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this DependencyConfig to a JSON map.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override