dart-get-selected-widget
To find the currently selected Flutter widget in the running app, get the selected widget after connecting to the Dart Tooling Daemon.
When & Why to Use This Skill
The dart-get-selected-widget skill enables developers to programmatically identify and retrieve metadata for the currently active Flutter widget within a running application. By connecting to the Dart Tooling Daemon (DTD), it provides real-time visibility into the widget tree, significantly accelerating the UI debugging and inspection process for Flutter and Dart developers.
Use Cases
- UI Layout Troubleshooting: Identify the specific widget causing rendering issues by selecting it in the running app and retrieving its properties and type.
- Interactive Debugging: Verify that the correct widget is being focused or selected during user interaction tests to ensure state management logic is working as intended.
- Code-to-UI Mapping: Streamline the development workflow by quickly mapping visual elements in the application interface to their corresponding definitions in the Flutter source code.
| name | dart-get-selected-widget |
|---|---|
| description | "To find the currently selected Flutter widget in the running app, get the selected widget after connecting to the Dart Tooling Daemon." |
Usage
Use the MCP tool dev-swarm.request to send the payload as a JSON string:
{"server_id":"dart","tool_name":"get_selected_widget","arguments":{}}
Tool Description
Retrieves the selected widget from the active Flutter application. Requires "connect_dart_tooling_daemon" to be successfully called first.
Arguments Schema
The schema below describes the arguments object in the request payload.
{
"type": "object"
}
Background Tasks
If the tool returns a task id, poll the task status via the MCP request tool:
{"server_id":"dart","method":"tasks/status","params":{"task_id":"<task_id>"}}