add<T> method

void add<T>(
  1. T factory(), {
  2. String? tag,
  3. bool lazy = false,
  4. bool singleton = true,
})

Register a service in the current scope

Implementation

void add<T>(T Function() factory,
    {String? tag, bool lazy = false, bool singleton = true}) {
  current.add<T>(factory, tag: tag, lazy: lazy, singleton: singleton);
}