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

outdated

A simple yet efficient IoC 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 {}
161
likes
0
pub points
95%
popularity

Publisher

verified publishergbtb16.com.br

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on kiwi