auto_injector 2.0.5 copy "auto_injector: ^2.0.5" to clipboard
auto_injector: ^2.0.5 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>());
}
95
likes
150
points
244k
downloads

Publisher

verified publisherflutterando.com.br

Weekly Downloads

Automatic Dependency Injection System, but without build_runner :)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

meta, uuid

More

Packages that depend on auto_injector