registerLazySingleton<T> method

void registerLazySingleton <T>(FactoryFunc<T> func, [ String instanceName ])

registers a type as Singleton by passing a factory function that will be called on the first call of get on that type T type to register func factory funtion for this type instanceName if you provide a value here your factory gets registered with that name instead of a type. This should only be nesseary if you need to register more than one instance of one type. Its highly not recommended

Implementation

void registerLazySingleton<T>(FactoryFunc<T> func, [String instanceName]) {
  _register<T>(
      type: _ServiceFactoryType.lazy,
      instanceName: instanceName,
      factoryFunc: func);
}