flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.58k stars 326 forks source link

Layout Explorer should maintain aspect ratio #3466

Open Hixie opened 2 years ago

Hixie commented 2 years ago

STEPS TO REPRODUCE

  1. Create a new app using the "skeleton" template.
  2. Run it.
  3. In the widget inspector, click on one of the ListTiles.

EXPECTED RESULTS I would have expected to see a horizontal rectangle, with the aspect ratio of the list tile.

ACTUAL RESULTS The visualization is sized to fit the screen, so even though it is labeled as "h=56" and "w=411.4", the box is actually taller than it is wide.

This gets worse e.g. when you tap the CircleAvatar widget, which is square (actually circular) in the real rendering, but appears like a vertical box in the widget inspector.

I think that, within reason, the aspect ratio of the child being displayed in the widget inspector should match the real aspect ratio. That would help orient the developer.

jacob314 commented 2 years ago

This would be a good improvement. We will still need to do some stylizing but we could be much more true to the original aspect ratio than we are currently. We'll need to make the UX degrade more gracefully when the H or W is very small or very large.