flutter / flutter/devtools

[User reported] On-device inspector doesn't always select a widget in an overlay

Offen
#9,555 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
cost: high P2 screen: inspector
Vorherrschende Sprache
Dart
Sterne
1.7k
Forks
404
Ø Merge
6 T. 17 Std.
Gemergte PRs (30 T.)
18

Beschreibung

This is a user-reported issue from the 2025 DevTools user survey.

A couple users reported that the on-device inspector doesn’t always select a widget in an overlay.

---

### Details:

Currently widget inspection does not work very well for cases such as overlays. The inspector is currently relying on a RenderObject’s hitTest, which doesn’t work for all cases.

It’s also difficult to figure out where to click in order to actually select a widget.

**A few ideas for how this might be improved:**
* Show bounding boxes on hover (see https://github.com/flutter/devtools/issues/7762)
* Along with hitTest, add a hitDebug method to some RenderObjects that would be used instead.
* If a hit test matches multiple routes, then choose the top one.
* Tie each pixel to a single RenderObject
* By default, only select widgets in a user’s project (implemented in https://github.com/flutter/flutter/pull/176530)

---

Related issue: https://github.com/flutter/devtools/issues/4869

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

No file or test is named in the issue. Start by reviewing the on-device inspector's RenderObject hitTest behavior, then read related issues 7762 and 4869 and the linked Flutter pull request 176530. Done should mean that widgets in overlays can be selected reliably through an agreed inspection approach.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
dart
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.