8000 GitHub - dnsang/di: A Dependency Injection package for flutter · GitHub
[go: up one dir, main page]

Skip to content
dnsangPublic

About

A Dependency Injection package for flutter

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

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"));
}

About

A Dependency Injection package for flutter

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

< 2EA7 div data-text-skeleton-size="bodyMedium" class="prc-SkeletonText-SkeletonText--DvUT prc-Skeleton-skeleton-Hkezl" style="width:100%" data-component="SkeletonText">
0