dart_inject 1.0.0
dart_inject: ^1.0.0

Dart native js
Flutter Android iOS web

A very simple and easy to use dependency injection framework for Dart.

dart_inject Build[coverage report] #

A very simple and easy to use dependency injection framework for Dart.

Usage #

A simple usage example:

import 'package:dart_inject/dart_inject.dart' as di;

abstract class Vehicle {
  String get name;
}

class Car implements Vehicle {
  String _name;

  @override
  String get name => _name;

  Car(String name) {
    _name = name;
  }
}

void main() {
  di.startup(() {
    di.register<Vehicle>(() => Car('BMW X6'));
  });

  var car = di.resolve<Vehicle>();
  var carName = car.name;
  print('I own a $carName');
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1
likes
100
pub points
56%
popularity

A very simple and easy to use dependency injection framework for Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

thbonk@gmail.com

License

Apache 2.0 (LICENSE)

More

Packages that depend on dart_inject