DependencyBuilder<T> typedef

DependencyBuilder<T> = T Function()

Gets registered at the injector and then gets called by the injector to instantiate the dependency and all of its dependencies.

Example:

final myInjector = Injector();

myInjector.registerDependency<Car>(() {
    var engine = myInjector.getDependency<Engine>();
    return CarImpl(engine: engine);
});

Implementation

typedef DependencyBuilder<T> = T Function();