injectable_generator 0.3.0 injectable_generator: ^0.3.0 copied to clipboard
Injectable is a convenient code generator for [get_it](https://pub.dev/packages/get_it). Inspired by Angular DI, Guice DI and inject.dart.
Example #
import 'package:injectable/injectable_annotations.dart';
abstract class Service {}
@RegisterAs(Service, env: 'dev')
@injectable
class ServiceImpl1 extends Service {}
@RegisterAs(Service, env: 'prod')
@injectable
class ServiceImpl2 implements Service {
}
@injectable
class MyRepository {
MyRepository(@Named.from(ServiceImpl1) Service service);
}