kiwi 0.2.0 copy "kiwi: ^0.2.0" to clipboard
kiwi: ^0.2.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() {
  Container container = Container();
  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 {}
154
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).

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on kiwi