kiwi 4.0.1
kiwi: ^4.0.1 copied to clipboard

A simple yet efficient dependency injection container for Dart and Flutter (can be coupled with the kiwi_generator package).

example/kiwi_example.dart

import 'package:kiwi/kiwi.dart';

main() {
  KiwiContainer container = KiwiContainer();
  container.registerInstance(Logger());
  container.registerSingleton((c) => Logger(), name: 'logA');
  container.registerFactory((c) => ServiceA(c.resolve<Logger>('logA')));
}

class Service {}

class ServiceA extends Service {
  ServiceA(Logger logger);
}

class Logger {}
92
likes
130
pub points
95%
popularity

Publisher

vanlooverenkoen.be

A simple yet efficient dependency injection container for Dart and Flutter (can be coupled with the kiwi_generator package).

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

meta

More

Packages that depend on kiwi