recordExistingReference method
void
recordExistingReference({})
Records a reference to an existing project entity and rejects if the same App has already queued a removal of that name.
Implementation
void recordExistingReference({
required String name,
required String kind,
required String referenceApi,
required String removeApi,
}) {
if (_pendingRemovals[kind]?.contains(name) ?? false) {
throw StateError(
'Cannot reference $kind "$name" via app.$referenceApi(...): this App '
'has already queued app.$removeApi("$name"). The removal would leave '
'this reference dangling at compile time.',
);
}
(_existingReferences[kind] ??= <String>{}).add(name);
}