ioc_container 0.2.0 copy "ioc_container: ^0.2.0" to clipboard
ioc_container: ^0.2.0 copied to clipboard

A Dart Ioc Container. Store and manage dependencies in one place keyed by type. It simplifies creating instances of your classes.

A Dart Ioc Container #

Code in lib/, and example unit test in test/.

You can do this. It's nice.


final a = A('a');
final builder = IocContainerBuilder();
builder
    .addSingleton(a)
    .add((i) => B(i.get<A>()))
    .add((i) => C(i.get<B>()))
    .add((i) => D(i.get<B>(), i.get<C>()));
final container = builder.toContainer();
var d = container.get<D>();
expect(d.c.b.a, a);
expect(d.c.b.a.name, 'a');

82
likes
0
pub points
86%
popularity

Publisher

verified publisherchristianfindlay.com

A Dart Ioc Container. Store and manage dependencies in one place keyed by type. It simplifies creating instances of your classes.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on ioc_container