Skip to content

Selecting an Element from the Devtool Widget Tree does not highlight the element in Multi View Apps #5935

Description

@CoderDake

While testing a multi view app I turned on Select Widget Mode and tried to click elements in the Summary tree.
No elements were highlighted in the apps view.

Activity

  1. changed the title [-]Selecting an[/-] [+]Selecting an Element from the Devtool Widget Tree does not highlight the element in Multi View Apps[/+] on Jun 20, 2023
  2. CoderDake commented on Jul 6, 2023

    @CoderDake
    ContributorAuthor

    for the widgets_counter.dart example, nothing is highlighted when clicking on the following elements in the DevTools widget tree:

    [root]
    MultiViewApp
    ViewCollection
    View
    Builder
    Counter
    MaterialApp

  3. added
    P3issues we think are valid but not important
    on Jul 17, 2023
  4. CoderDake commented on Jul 17, 2023

    @CoderDake
    ContributorAuthor

    Discussed this with the team and it was decided that findRenderObject returns null then there is no need to highlight anything.

    That being said I believe the following should render as having a selection:

    • View
    • Builder
    • Counter
    • MaterialApp

    Unfortunately I seem to run into issues when selecting those.

  5. CoderDake commented on Jul 18, 2023

    @CoderDake
    ContributorAuthor

    It looks like the size of the _RenderInspectorOverlay size is 0, so perhaps there is something that has changed with those widgets and the way we get their size and offset
    https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/widget_inspector.dart#L3014

  6. CoderDake commented on Jul 18, 2023

    @CoderDake
    ContributorAuthor

    After using the debugger I was able to realize that Anything MaterialApp and above isn't inspectable. Only Widgets under MaterialApp should be inspectable.
    Tested in a single view app i can see the same behaviour.

    This still doesn't explain why widget inspection ends up breaking when clicking on theses widgets in multi view apps.

    Now that I've got a clearer idea it should be easier to check how big of an issue this is, and whether using the same flutter engine for single view apps would cause the same issues.

  7. CoderDake commented on Jul 21, 2023

    @CoderDake
    ContributorAuthor

    So it looks like the breaking widget inspection had to do with a mysterious extra view showing up in the widget tree.
    Then when inspecting an element in that view, the following error would get thrown: #6032

    After that it would seem as if the inspector behaviour had broken everywhere.

    So it looks like this is all clear and the issue isn't caused by the widgets mentioned above :D

  8. CoderDake commented on Jul 21, 2023

    @CoderDake
    ContributorAuthor

    Flutter Engine issue that caused the Ghost View to show up:
    flutter/flutter#131089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3issues we think are valid but not important

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions