Unverified Commit 186659dc authored by Daniel Chevalier's avatar Daniel Chevalier Committed by GitHub

Show width and height in inspector overlay (#140709)

![](https://media.giphy.com/media/SX71qs3TDxVkvbLJ4o/giphy-downsized.gif)

Fixes https://github.com/flutter/devtools/issues/6871

Add the width and height to the inspector overlay. 1 decimal precision is used since that matches the way Devtools displays the values.

## Examples
<img width="442" alt="Screenshot 2023-12-28 at 2 39 49 PM" src="https://github.com/flutter/flutter/assets/1386322/2de40092-de15-4ada-a954-e911e6bef217">

<img width="645" alt="Screenshot 2023-12-28 at 2 39 42 PM" src="https://github.com/flutter/flutter/assets/1386322/8f53dad5-1aba-43d9-9419-ca93cd894624">
<img width="149" alt="Screenshot 2023-12-28 at 2 39 37 PM" src="https://github.com/flutter/flutter/assets/1386322/bbed74b7-c962-4c20-80d8-48e5eaa14de6">
parent 396a5304
......@@ -3188,11 +3188,15 @@ class _InspectorOverlayLayer extends Layer {
}
candidates.add(_TransformedRect(candidate, rootRenderObject));
}
final _TransformedRect selectedRect = _TransformedRect(selected, rootRenderObject);
final String widgetName = selection.currentElement!.toStringShort();
final String width = selectedRect.rect.width.toStringAsFixed(1);
final String height = selectedRect.rect.height.toStringAsFixed(1);
final _InspectorOverlayRenderState state = _InspectorOverlayRenderState(
overlayRect: overlayRect,
selected: _TransformedRect(selected, rootRenderObject),
tooltip: selection.currentElement!.toStringShort(),
selected: selectedRect,
tooltip: '$widgetName ($width x $height)',
textDirection: TextDirection.ltr,
candidates: candidates,
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment