A modern dependency injection pacakge for dart, like java spring!
Clone or download




Part of the Dart Force Framework.

A library to do dependency injection! It uses the same annotations as in java spring applications.


To bootstrap your injections call


To configure your classes make a configuration class

class SomeConfig {

  Counter counter() {
    return new Counter();

  Calc calc() {
    return new Calc();


When you want to access an instance you can call


You can also define Components by using the @Component annotation

For the moment we only support set dependency injections and not constructor dependency injection.


You can use a Qualifier to give the bean a specific name, it is usefull when you want to configure 2 instances of the same class.

@Qualifier(name: "firstCounter")
Calc calc() {
	return new Calc();


You can add yaml values into your classes. First add them to the applicationContext. The first value is the key of the messages and the second value is the yaml content.

ApplicationContext.registerMessage("sentences", "sentence: Is this good?");

Register the messages before calling the method bootstrap of ApplicationContext.

You can add the @Value annotation into a scanned bean.

String value;

You can also get a value from ApplicationContext, like follow:



With the @order annotation we can set the order of a configuration class.

class ConfigComp { }


  • add posibility to add @Autowired in constructor values

Notes to Contributors

Fork Wired

If you'd like to contribute back to the core, you can fork this repository and send us a pull request, when it is ready.

If you are new to Git or GitHub, please read this guide first.

Dart Force

Realtime web framework for dart that uses forcemvc & forcemirrors & wired source code


Follow us on twitter https://twitter.com/usethedartforce


Follow us on google+