auto_injector 0.0.1-alpha auto_injector: ^0.0.1-alpha copied to clipboard
Dependency injection system. But without build_runner :)
Auto Injector #
Dependency injection system. But without build_runner :)
IMPORTANT! #
This package is still under development.
Example #
void main(){
final autoInjector = AutoInjector();
// registration
autoInjector.add(Controller.new);
autoInjector.add(Repository.new);
autoInjector.add(Datasource.new);
// fetch
final controller = autoInjector.get<Controller>();
print(controller); // Instance of 'Controller'.
}
class Controller {
final Repository repository;
Controller(this.repository)
}
class Repository {
final Datasource datasource;
Repository({required this.datasource})
}
class Datasource {}