registerSupertypes static method
Register supertype relationships for bridged classes.
Each key is a class name, and the value is a list of its supertype names.
Example: {'StatelessWidget': 'Widget', 'DiagnosticableTree'}
Idempotent: The per-key value is a Set, and we use Set.addAll
— repeated calls with the same hierarchy add nothing the second time.
Safe to invoke twice when a process re-runs a generator-emitted
registerProxyFactories() block (e.g. on a second FlutterD4rt
instance after _relaxersRegistered is removed).
Implementation
static void registerSupertypes(Map<String, List<String>> hierarchy) {
for (final entry in hierarchy.entries) {
_supertypeRegistry
.putIfAbsent(entry.key, () => {})
.addAll(entry.value);
}
}