AutoInjector constructor
AutoInjector({
- String? tag,
- List<
ParamTransform> paramTransforms = const [], - void on(
- AutoInjector injector
Automatic Dependency Injection System, but without build_runner :)
[tag]
: AutoInject instance identity.
[on]
: Helps with instance registration.
[paramObservers]
: List of functions that listen and transform
parameters while they are being parsed when
requested by the get()
method.
final injector = AutoInjector();
injector.add(MyDatasource.new);
injector.get<MyDatasource>();
Implementation
factory AutoInjector({
String? tag,
List<ParamTransform> paramTransforms = const [],
void Function(AutoInjector injector)? on,
}) {
tag ??= const Uuid().v4();
return AutoInjectorImpl(tag, paramTransforms, on);
}