devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Automatic Source Code Opening in Legacy is 100x Simpler than New Flutter DevTools

Open DrAlexHarrison opened this issue 1 year ago • 7 comments

I am now using legacy to gain faster access to source code than possible with non-legacy Flutter DevTools build.

Summary: It was impossible for me to figure out how to locate elements on emulator clicks in my source code, using flutter DevTools new version. I pray you don't force migration to it until that is made automatic or painlessly easy in more use cases.

Context: I'm a newer dev. I read all Flutter DevTools docs, talked to GPT-o3 and Gemini 2.5 for 30+ minutes and could not figure out how to click something in my emulator and have it give me a filepath, let alone automatically jump to its location in my source code in VS Code.

I switched to legacy and it did it immediately, seamlessly. I'll stick with legacy for now.

LOCATION

  • Page: Flutter DevTools Flutter Inspector interaction with VS Code
  • Element: Widget Details Pane, filepath, source code location (not shown) EXPECTED BEHAVIOR
  • Easy access to filepath to my source code, or auto-open of the location in code. ACTUAL BEHAVIOR
  • No file path shown for any widgets explored by any method.

DevTools version: 2.45.1 (legacy vs. non-legacy) IDE: VSCode Connected Device: CPU / OS: x64 (64 bit) android Connected app type: Flutter native (debug build) Dart Version: 3.8.1 Flutter Version: 3.32.2 / stable Framework / Engine: 8defaa71a7 / 1091508939

PS. I saw a note somewhere in the UI that the Flutter DevTools team would like to hear why folks might stick with legacy by having them file a bug report. I hope this is helpful to someone somewhere!

DrAlexHarrison avatar Jun 09 '25 00:06 DrAlexHarrison

@DrAlexHarrison just to confirm the issue, when you use the widget selector to select a widget in the emulator, it isn't navigating to that widget location in the code (in your IDE)?

jakemac53 avatar Jun 09 '25 14:06 jakemac53

That's correct. I did get that functionality to work temporarily in legacy. It later failed in legacy for me, and I haven't investigated since. It has never worked for me in non-legacy. (It may be me and my system. I'm inexperienced enough at this that it's reasonably likely I'm overlooking something someone more experienced would just know/see.)

DrAlexHarrison avatar Jun 09 '25 15:06 DrAlexHarrison

@DrAlexHarrison can you try upgrading to the latest flutter stable? DevTools 2.45.3 should be the latest version on Flutter stable and has some fixes related to this exact issue.

kenzieschmoll avatar Jun 09 '25 15:06 kenzieschmoll

Good call. Updated. How do I get DevTools to follow suit?


DevTools version: 2.45.1 IDE: VSCode Connected Device: CPU / OS: x64 (64 bit) android Connected app type: Flutter native (debug build) Dart Version: 3.8.1 Flutter Version: 3.32.2 / stable Framework / Engine: 8defaa71a7 / 1091508939

DrAlexHarrison avatar Jun 09 '25 15:06 DrAlexHarrison

The beta channel has version 2.46.0 if you are able to try that (flutter channel beta && flutter upgrade).

jakemac53 avatar Jun 09 '25 17:06 jakemac53

+1 to trying the beta channel if you are still seeing the issue on the latest stable.

Regarding the DevTools version on the latest stable, my apologies - I was incorrect. DevTools 2.45.1 is the latest version on stable. The latest Flutter stable is 3.32.2, so do try to see if you are still seeing the issue on this latest stable release which includes some hotfixes that may resolve the issue you are seeing:

Flutter 3.32.2 • channel stable • [email protected]:flutter/flutter.git
Framework • revision 8defaa71a7 (5 days ago) • 2025-06-04 11:02:51 -0700
Engine • revision 1091508939 (10 days ago) • 2025-05-30 12:17:36 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1

kenzieschmoll avatar Jun 09 '25 17:06 kenzieschmoll

Without additional information we're not able to resolve this issue, so it will be closed at this time. You're still free to add more info and respond to any questions above, though. We'll reopen the case if you do. Thanks for your contribution!

github-actions[bot] avatar Jun 24 '25 00:06 github-actions[bot]