Inject class

Annotation to inject a dependency

Used to mark fields for automatic dependency injection.

Example:

@Inject()
late AuthService authService;

@Inject('custom_key')
late ApiClient api;

Constructors

Inject([String? key])
const

Properties

hashCode int
The hash code for this object.
no setterinherited
key String?
Custom key for DI lookup (defaults to type)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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