AutoInjector constructor

AutoInjector({
  1. String? tag,
  2. List<ParamTransform> paramTransforms = const [],
  3. void on(
    1. 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);
}