locator 0.0.0-dev.2
locator: ^0.0.0-dev.2 copied to clipboard
A package that simplifies dependency injection across Luminucx applications, making resource allocation easy especially when using clean architecture.
Locator #
A package that simplifies dependency injection across Luminucx applications, making resource allocation easy especially when using clean architecture.
Getting started #
add a git ref or url of this package to your yml file as a dependency.
Features #
- inject dependencies for later use using Locator.put
- get injected dependencies using Locator.get
Usage #
class Service{
final String someData;
const Service(this.someData);
///... does some stuff
}
Locator().put<Service>(Service(""));
// can later now extract the instance
Locator().get<Service>().someData;