A Practical Debugging Workflow
This guide demonstrates how to use the Flutter MCP Toolkit to debug a common issue: a UI that doesn't look right.
The Scenario
Imagine you have a button that is supposed to be centered on the screen, but it's appearing in the top-left corner.
The Workflow
-
Capture Unified Evidence: First, ask your AI assistant to run
capture_ui_snapshotto collect screenshots, view details, and app errors together."Capture a UI snapshot bundle."
-
Inspect Problem Coordinates: Use
inspect_widget_at_pointfor the suspicious screen position to map what widget/render object is actually there."Inspect widget at x=120 y=220."
-
Identify the Problem: By examining widget-tree output and route/source hints, you might discover that the button is not wrapped in a
Centerwidget. -
Fix the Code: Now, you can ask the AI to fix the code by wrapping the button in a
Centerwidget."Wrap the button in a Center widget."
-
Hot Reload and Verify: Finally, hot reload the app and take another screenshot to verify that the button is now centered.
"Hot reload the app and take another screenshot."
This workflow demonstrates how the Flutter MCP Toolkit can be used to quickly and efficiently debug UI issues with visual evidence and source mapping.