-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
As I'm working with user interfaces that have more complex focus and IME interactions, I'm finding it difficult to track associated changes.
I think it would be helpful to be able to visualize the focus path, from root, to the widget with primary focus. For example, all widgets in the focus path might be given a border and a tiny number in the corner that shows the tree distance from the root. The widget with primary focus could have a special color.
Also, I'd like to be able to track changes to the IME connection. For example, is an IME connection open right now? Ideally, I'd also like to know which widget owns that IME connection. That later part is more difficult, because there's no requirement that a widget own the IME connection. So maybe that requires an opt-in API. Nonetheless, when debugging issues at moments where one widget's IME connection closes and another is supposed to open, it would be helpful to have some quick toggle-able visual indicators through Flutter Inspector.
EDIT:
Here are a couple other ideas as I'm working through focus issues.
- Log why each focus change happens. Did a node request "unfocus"? Did another node request "focus"? Focus changed in some way that I didn't want it to, but it's unclear how to root cause what happened, because anything in the entire app could be involved with the change.
- Tap to select a widget that handles gestures. Flutter already has a "tap to select widget" mode in the inspector. But what about when I'm looking for the widget that handles gestures at a particular (x,y)? With things like
Stacks, it's easy to end up with invisible or translucent widgets that sit on top of the widget that handles a gesture. This makes it difficult to locate which widget is actually handling a tap, for example.