lazySingleton<T> method
Registers a factory that will be executed once and its result stored as a singleton.
Implementation
void lazySingleton<T>(T Function(Container) factory, {String? name}) {
_factories[_key<T>(name)] = (c) {
final res = factory(c);
_singletons[_key<T>(name)] = res;
return res;
};
}