wired 0.4.5

  • readme.md
  • Installing
  • Versions
  • 8



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+


This file contains highlights of what changes on each version of the wired package.

Pub version 0.4.5

  • @Value annotations can now be any valid YAML value

Pub version 0.4.4

  • At annotation @order into the library, @order helps you to order the configuration classes.

Pub version 0.4.3+1

  • look at interfaces on all levels (getBeanByType)

Pub version 0.4.3

  • getBeanByType, also look at his interfaces!

Pub version 0.4.2

Fix issue with getBeanByType, when more beans are in the pool, adapt tests

Pub version 0.4.1

Adapting getBeanByType so it will accept also and can work with subclasses and superclasses

Pub version 0.4.0

Adding setBean method in ApplicationContext Update dependencies to mirrorme (renaming forcemirrors) this is not bc

Pub version 0.3.2+1

Update YAML dependency.

Pub version 0.3.2

Add static method getBeanByType on ApplicationContext Also resolve autowired cases by Type and not only by name Rename package to 'wired'

Pub version 0.3.1

Improved the addComponents method

Pub version 0.3.0

Add documentation Change component(Scanner scanner) to addComponents(Iterable objs) Change MetaDataHelper().getVariableMirrorValues(obj) to MetaDataHelper<_Autowired, VariableMirror>().from(obj) Change MetaDataHelper().getMirrorValues(obj) to MetaDataHelper<_Bean, MethodMirror>().from(obj)

Pub version 0.2.1+1

Moving repo to ForceUniverse organisation

Pub version 0.2.1

Fix scanning of config classes and component classes.

Pub version 0.2.0

Remove parentheses from annotations.

Pub version 0.1.3+2

Yaml value can be anything! Change the return type to dynamic to get a value!

Pub version 0.1.3+1

Adding a method to get a value from a yaml file through ApplicationContext.

Pub version 0.1.3

Now you can inject yaml values into your dart classes.

Pub version 0.1.2

Adding the Qualifier annotation to this package, so you can name the beans you configure.

Pub version 0.1.1 & 0.1.1+1

Make it possible to switch order of the classes when they are created!

Pub version 0.1.0+1

Adding documentation

Pub version 0.1.0

Initial setup of the package

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  wired: ^0.4.5

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:wired/wired.dart';
Version Uploaded Documentation Archive
0.4.5 Jun 3, 2016 Go to the documentation of wired 0.4.5 Download wired 0.4.5 archive
0.4.4 Dec 15, 2015 Go to the documentation of wired 0.4.4 Download wired 0.4.4 archive
0.4.3+1 Jan 22, 2015 Go to the documentation of wired 0.4.3+1 Download wired 0.4.3+1 archive
0.4.3 Jan 17, 2015 Go to the documentation of wired 0.4.3 Download wired 0.4.3 archive
0.4.2 Jan 16, 2015 Go to the documentation of wired 0.4.2 Download wired 0.4.2 archive
0.4.1 Jan 16, 2015 Go to the documentation of wired 0.4.1 Download wired 0.4.1 archive
0.4.0 Jan 8, 2015 Go to the documentation of wired 0.4.0 Download wired 0.4.0 archive
0.3.2+1 Oct 11, 2014 Go to the documentation of wired 0.3.2+1 Download wired 0.3.2+1 archive
0.3.2 Aug 31, 2014 Go to the documentation of wired 0.3.2 Download wired 0.3.2 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.1.0.
 Because wired depends on mirrorme any which requires SDK version <2.0.0, version solving failed.

Health suggestions

Format lib/src/annotations/annotations.dart.

Run dartfmt to format lib/src/annotations/annotations.dart.

Format lib/src/di/bootstrap.dart.

Run dartfmt to format lib/src/di/bootstrap.dart.

Format lib/src/di/messages_context.dart.

Run dartfmt to format lib/src/di/messages_context.dart.

Format lib/wired.dart.

Run dartfmt to format lib/wired.dart.

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-50 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Package is too old. (-100 points)

The package was released more than two years ago.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use wired.dart.