registerFactoryAsync<T extends Object> method
void
registerFactoryAsync<T extends Object>(})
Registers a type so that a new instance will be created on each call of getAsync on that type
the creation function is executed asynchronously and has to be accessed with getAsync
T
type to register
factoryfunc
async factory function 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 necessary if you need to register more
than one instance of one type. Its highly not recommended
Implementation
void registerFactoryAsync<T extends Object>(
FactoryFuncAsync<T> factoryfunc, {
String? instanceName,
Set<String>? registerFor,
}) {
if (_canRegister(registerFor)) {
locator.registerFactoryAsync<T>(
factoryfunc,
instanceName: instanceName,
);
}
}