Skip to content

Error: Flutter Inspector navigates to framework source instead of user code in Flutter 3.22.3 #9252

Open
@xuvien

Description

@xuvien

Description

In Flutter 3.32.3, the Flutter Inspector no longer navigates to the widget usage in my codebase when selecting a widget from the widget tree. Instead, it opens the widget definition from the Flutter SDK itself.

For example, when I select a CupertinoButton in the Flutter Inspector, instead of opening the line where I used CupertinoButton in my own Dart file (e.g. home_screen.dart), it jumps directly to the Flutter SDK source (cupertino.dart).

This behavior breaks the expected functionality where the Inspector should navigate to the actual widget usage in user code (i.e. call site), not its definition.


Steps to Reproduce:

  1. Create a Flutter app.

  2. Use a standard widget like CupertinoButton or ElevatedButton in your widget tree:

CupertinoButton(
  child: Text('Click'),
  onPressed: () {},
)
  1. Run in debug mode with Flutter 3.32.3

  2. Open Flutter Inspector and select the button widget in the widget tree.

  3. Inspector opens the Flutter SDK source instead of your own Dart file.


Expected Behavior:

Flutter Inspector should open the file and line where the widget is used in my application code, not inside the Flutter SDK.


Actual Behavior:

Inspector opens cupertino.dart, material.dart, or another SDK file where the widget is defined, ignoring the actual location of usage in my project.

Activity

changed the title [-]Flutter Inspector navigates to framework source instead of user code in Flutter 3.22.3[/-] [+]Error: Flutter Inspector navigates to framework source instead of user code in Flutter 3.22.3[/+] on Jun 12, 2025
jakemac53

jakemac53 commented on Jun 12, 2025

@jakemac53
Contributor

This could be a flutter issue, if the widget locations are being reported differently now?

jakemac53

jakemac53 commented on Jun 12, 2025

@jakemac53
Contributor

Possible related issue #8802?

added
bugSomething isn't working
P2important to work on, but not at the top of the work list.
on Jun 12, 2025
jakemac53

jakemac53 commented on Jun 12, 2025

@jakemac53
Contributor

We should escalate this to a P1 potentially if we are able to reproduce it or get more reports/+1s

kenzieschmoll

kenzieschmoll commented on Jun 12, 2025

@kenzieschmoll
Member

This issue also looks related to #9063, which may provide some breadcrumbs for debugging / finding a fix.

xuvien

xuvien commented on Jun 13, 2025

@xuvien
Author

Would love to see this fixed — Inspector should go to the widget usage in user code by default.

That said, the current behavior could be useful for debugging 3rd-party packages or checking if a bug comes from the SDK. Maybe this "bug" could become a feature: add a checkbox like:

"Prefer navigating to widget definition"

Fix first, then make it toggleable — best of both worlds. ❣️

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

    P2important to work on, but not at the top of the work list.bugSomething isn't workingscreen: inspector

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jakemac53@kenzieschmoll@xuvien

        Issue actions

          Error: Flutter Inspector navigates to framework source instead of user code in Flutter 3.22.3 · Issue #9252 · flutter/devtools