factoryFind<T, A> method
T
factoryFind<T, A>({
- A? arguments,
Search and return one instance T from the hashmap
Implementation
T factoryFind<T, A>({A? arguments}) {
final key = _getKey(T, null);
// check if the dependency is a factory
final inFactoryVars = _factoryVars.containsKey(key);
if (inFactoryVars) {
return (_factoryVars[key] as _Factory<T, A>).builder(arguments);
}
throw AssertionError(
'Cannot find $key, make sure call to Get.i.factoryPut<${T.toString()}>() before call factoryFind.',
);
}