Skip to content

Add a version of the Flutter: Inspect Widget command that auto-cancels on selection #4093

Closed

Description

@maks

I often want to click on a UI element and see the line of widget code where its defined.

Currently this is eminently doable but involves the following steps:

  • click "open devtools" button in debug bar
  • in Devtools click on "select widget mode" button
  • click on the widget I'm interested in the Flutter running app
  • switch back to VSCode window (I run Devtools not in embedded mode)
  • Remember to go back to Devtools to un-toggle "select widget mode" button
  • close devtools tab in web browser

It would be really nice if there was a single VSCode command palette command that I could use to do all of the above in one go, ie. select the cmd in the cmd palette, click on the widget I'm interested in the running app and then VSCode jumps to the relevant code line and exists out of "select widget mode".

Activity

  1. DanTup commented on Aug 8, 2022

    @DanTup
    Member

    There are already commands for toggling this without needing DevTools:

    Screenshot 2022-08-08 at 15 13 07

    Screenshot 2022-08-08 at 15 27 11

    I think that reduces this to two steps (plus clicking a widget). Adding an additional command that auto-cancels on the first selection doesn't seem like a bad idea though.

  2. changed the title [-]feature request: command to do usual show Widget in code procedure[/-] [+]Add a version of the Flutter: Inspect Widget command that auto-cancels on selection[/+] on Aug 8, 2022
  3. added this to the v3.48.0 milestone on Aug 8, 2022
  4. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    in flutterRelates to running Flutter apps
    on Aug 8, 2022
  5. maks commented on Aug 8, 2022

    @maks
    Author

    Ok wow, @DanTup, I think I need to spend more time looking through all the commands provided by DartCode! as I completely missed this one! But yes having a setting that cancels on first selection would be perfect 🙏🏻 Thanks for updating the title, that pretty much is exactly what I'm after 👍🏻

  6. modified the milestones: v3.48.0, v3.50.0 on Aug 25, 2022
  7. modified the milestones: v3.50.0, v3.52.0 on Oct 3, 2022
  8. DanTup commented on Oct 3, 2022

    @DanTup
    Member

    I discovered the new DAPs don't support Inspect Widget correctly (that is, they don't navigate in the editor) so it makes sense to fix that (#4193) before tackling this, since it's possible the mechanism used for navigating will change a bit.

  9. DanTup commented on Oct 31, 2022

    @DanTup
    Member

    There's a new command "Flutter: Inspect Widget (Auto-Cancel after Selection)" that will cancel the widget selection mode 1s after you click a widget (the delay is because it will also remove the visible selection of the widget on the app, and it looks buggy to have it disappear immediately when you tap).

  10. maks commented on Nov 1, 2022

    @maks
    Author

    Awesome! Thanks again @DanTup !

  11. added a commit that references this issue on Sep 2, 2025
    5cab904
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

    in flutterRelates to running Flutter appsis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions