Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dnsang/di
A Dependency Injection package for flutter
https://github.com/dnsang/di
dart dartlang dependency dependency-injection di flutter
Last synced: 2 days ago
JSON representation
A Dependency Injection package for flutter
- Host: GitHub
- URL: https://github.com/dnsang/di
- Owner: dnsang
- License: mit
- Created: 2019-07-01T06:47:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-01T09:00:46.000Z (over 5 years ago)
- Last Synced: 2023-08-24T02:54:49.894Z (about 1 year ago)
- Topics: dart, dartlang, dependency, dependency-injection, di, flutter
- Language: Dart
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Dart Dependency Injection
**Getting Started**
1/ Binding:
class TestModule extends AbstractModule {
@override
void init() {
bind(String).to("A String Instance");
bind(int).to(404);
bind(TestClass).to(new TestClass(this.get(String)));
bind("AnotherTestClass").to(new TestClass("AnotherTestClass"));
}
}2/ Use your DI
void main() {
DI.init([new TestModule()]);
String str = DI.get(String);
expect(str, equals("A String Instance"));
}