McpWidgetRegistry class
Registro de widgets testables via MCP.
Cada widget que quiera ser controlado por Claude debe registrarse aquí con un McpMetadataKey que define su ID, tipo y capabilities.
El registro crea una GlobalKey interna que debe asignarse al widget en el árbol de Flutter para que el executor pueda obtener su context.
Properties
-
entries
→ Iterable<
MapEntry< String, ({GlobalKey< >State< globalKey, McpMetadataKey metadata})>StatefulWidget> > -
Retorna los entries del registro para iteración en el executor.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getAllWidgetIds(
) → List< String> - Lista todos los IDs de widgets registrados.
-
getAllWidgets(
) → List< McpMetadataKey> - Lista toda la metadata de widgets registrados.
-
getContext(
String id) → BuildContext? - Retorna el BuildContext del widget montado, o null si no está en pantalla.
-
getGlobalKey(
String id) → GlobalKey< State< ?StatefulWidget> > - Retorna la GlobalKey interna para asignar al widget en el árbol.
-
getRenderBox(
String id) → RenderBox? - Retorna el RenderBox del widget, necesario para calcular posición y tamaño.
-
getWidgetMetadata(
String id) → McpMetadataKey? - Retorna la metadata de un widget específico.
-
isRegistered(
String id) → bool -
Retorna true si el widget con
idestá registrado. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerWidget(
McpMetadataKey key) → void - Registra un widget y crea su GlobalKey interna.
-
toJson(
{String? screen, String? route}) → Map< String, dynamic> - Genera el JSON de contexto consumido por el servidor MCP externo.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterWidget(
String id) → void - Elimina un widget del registro.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → McpWidgetRegistry
-
final