decreaseReferences method
Substracts 1 to references for given type
Implementation
void decreaseReferences(String scopeId, Type type, {int index = 0}) {
if (_references.containsKey(scopeId)) {
final typesCounts = _references[scopeId]!;
if (typesCounts.containsKey(type) && typesCounts[type] != null) {
final objects = typesCounts[type]!;
if (objects.isEmpty) {
return;
}
if (index < 0 || index >= objects.length) {
throw IllegalArgumentException(
message:
'The index = $index value must be non-negative and less than count of references of $type in $scopeId.',
);
}
objects[index] = objects[index] - 1;
}
}
}