ddi 0.1.1 copy "ddi: ^0.1.1" to clipboard
ddi: ^0.1.1 copied to clipboard

A lightweight powerful Dependency Injection package brought to you by XED. DDI will make your development & debuging easier & faster.

example/main.dart

import 'package:ddi/di.dart';
import 'package:ddi/module.dart';

import 'logger.dart';

void main(List<String> args) {
  DI.init([new ExampleModule()]);

  Logger logger = DI.get(Logger);
  logger.debug("Hello Dart Dependency Injection");  
  var logger2 = DI.get<Logger>(Logger);
  logger2.debug("Hello Dart Dependency Injection");
}

class ExampleModule extends AbstractModule{
  @override
  void init() {
    bind(Logger).to(new ConsoleLogger());
  }
  
}
2
likes
40
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight powerful Dependency Injection package brought to you by XED. DDI will make your development & debuging easier & faster.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on ddi