auto_injector 1.0.2+2 copy "auto_injector: ^1.0.2+2" to clipboard
auto_injector: ^1.0.2+2 copied to clipboard

Automatic Dependency Injection System, but without build_runner :)

example/auto_injector_example.dart

import 'package:auto_injector/auto_injector.dart';

final homeModule = AutoInjector(
  paramTransforms: [
    (param) {
      return param;
    }
  ],
  on: (i) {
    i.addInjector(productModule);
    i.addInjector(userModule);
    i.commit();
  },
);

final productModule = AutoInjector(
  on: (i) {
    i.addInstance(1);
  },
);

final userModule = AutoInjector(
  on: (i) {
    i.addInstance(true);
  },
);

void main() {
  print(homeModule.get<int>());
  print(homeModule.get<bool>());
}
92
likes
0
pub points
88%
popularity

Publisher

verified publisherflutterando.com.br

Automatic Dependency Injection System, but without build_runner :)

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on auto_injector