registerGenericTypeWrapper static method
Register a wrapper factory for a generic base type (additive).
Multiple factories can be registered for the same base type — each module contributes factory cases for its own types. Factories are checked in registration order during extractBridgedArg resolution; the first to return non-null wins.
The baseTypeName is the unparameterized type name (e.g., 'WidgetStateProperty').
The factory receives the raw value and the desired inner type argument string.
Idempotent: If the same factory (compared by identity) has
already been registered for baseTypeName, the call is a no-op.
Distinct factories for the same base type are still appended in
registration order. This lets registerRelaxers() and similar
generator-emitted blocks fire multiple times (e.g. on a second
FlutterD4rt instance) without growing the per-key list.
Implementation
static void registerGenericTypeWrapper(
String baseTypeName,
GenericTypeWrapperFactory factory,
) {
final identities =
_genericTypeWrapperIdentities.putIfAbsent(baseTypeName, () => {});
if (!identities.add(factory)) return;
(_genericTypeWrappers[baseTypeName] ??= []).add(factory);
}