Description
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:
-
Create a Flutter app.
-
Use a standard widget like CupertinoButton or ElevatedButton in your widget tree:
CupertinoButton(
child: Text('Click'),
onPressed: () {},
)
-
Run in debug mode with Flutter 3.32.3
-
Open Flutter Inspector and select the button widget in the widget tree.
-
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
[-]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[/+]jakemac53 commentedon Jun 12, 2025
This could be a flutter issue, if the widget locations are being reported differently now?
jakemac53 commentedon Jun 12, 2025
Possible related issue #8802?
jakemac53 commentedon Jun 12, 2025
We should escalate this to a P1 potentially if we are able to reproduce it or get more reports/+1s
kenzieschmoll commentedon Jun 12, 2025
This issue also looks related to #9063, which may provide some breadcrumbs for debugging / finding a fix.
xuvien commentedon Jun 13, 2025
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. ❣️