kiwi 2.1.1 copy "kiwi: ^2.1.1" to clipboard
kiwi: ^2.1.1 copied to clipboard

outdated

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 {}
164
likes
30
points
39.6k
downloads

Publisher

verified publishergbtb16.com.br

Weekly Downloads

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

License

MIT (license)

Dependencies

meta

More

Packages that depend on kiwi