DependencyInjectable class

Marks a class as eligible for dependencyInjectionFactory() generation.

The generator inspects the annotated class's default constructor and emits a matching factory <Class>.dependencyInjectionFactory() that resolves each parameter from IRegistry. Parameters annotated with @Subkey(...) are resolved with that subkey instead of 'default', which disambiguates multiple parameters sharing the same interface type.

subkey controls how the --registry-output file registers this class instead: registerAllSingletons() connects it under that subkey rather than 'default'. Use it when two @dependencyInjectable classes implement the same interface and must both be wired up automatically — e.g. @DependencyInjectable(subkey: 'eu') / @DependencyInjectable(subkey: 'us') on two classes implementing the same interface, so registerAllSingletons() connects each under its own subkey instead of the second silently overwriting the first.

Constructors

DependencyInjectable({String? subkey})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subkey String?
The subkey registerAllSingletons() connects this class under, instead of 'default'. null means the default subkey.
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