GeneratedInjection mixin

Mixin for automatic dependency injection

Use this with modules that need DI:

class MyModule extends AppModule with GeneratedInjection {
  @Inject() late AuthService auth;

  @override
  void injectDependencies() {
    auth = inject<AuthService>();
  }
}

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

inject<T>() → T
Helper to get a dependency
injectByKey<T>(String key) → T
Helper to get a dependency by key
injectDependencies() → void
Override to inject dependencies
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