getOrCreateInstance method
T?
getOrCreateInstance(
{ - required String scopeId,
- required String scopeName,
})
override
Implementation
@override
T? getOrCreateInstance({required final String scopeId, required final String scopeName}) {
if (scopeId == SingletonScope.scopeId) return null;
if (scopeName != _scopeName) return null;
var sharedInstance = _sharedInstanceMap[scopeId];
if (sharedInstance == null) {
sharedInstance = createInstance();
_sharedInstanceMap[scopeId] = sharedInstance;
}
return sharedInstance;
}