Show widget file path in inspector - #9972
Open
khanak0509 wants to merge 3 commits into
Open
Conversation
khanak0509
requested review from
a team,
kenzieschmoll and
srawlins
as code owners
August 20, 2026 14:29
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the display of a widget's creation source location (file name, line, and column) in the DevTools Inspector. It updates the InspectorController to fetch this information from the details subtree, adds a new WidgetCreationLocationHeader widget to display it, and includes corresponding unit tests. The review feedback highlights a potential crash if the controller is disposed during an asynchronous operation, suggests a defensive null check for the node ID in getDetailsSubtree, and recommends using a null-assertion operator to satisfy strict null safety in the creation location header.
khanak0509
force-pushed
the
fix-inspector-widget-file-path
branch
from
August 20, 2026 14:37
e7abfc7 to
f360e4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #9922
This PR fixes issue #9922 where the new Flutter Inspector didn’t show the widget’s file path like the legacy inspector did. You could select a widget and see layout/properties on the right, but there was no
main.dart:line:columnanywhere — the summary tree is loaded without full details, socreationLocationnever showed up in the UI.How I fixed it:
Basically, when a widget is selected we fetch a small details subtree for just that node, read
creationLocation, and showfilename.dart:line:columnabove the properties tabs. The widget tree load stays the same so we don’t pull full details for every node.before --

after --
Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.