registerWidget method
Registers a widget and creates its internal GlobalKey.
Call this method before mounting the widget in the tree. The resulting key is obtained with getGlobalKey and assigned to the widget.
If the ID already exists, it overwrites the previous registration.
Implementation
void registerWidget(McpMetadataKey key) {
Log.i('[Registry] 📝 Registering: ${key.id} (${key.widgetType.name})');
_widgets[key.id] = (
metadata: key,
globalKey: GlobalKey(debugLabel: 'MCP:${key.id}'),
);
}