r/FlutterDev • • Feb 28 '19

Tooling VS Code extension adds Dart DevTools integration for a Flutter Inspector 🎉

https://dartcode.org/releases/v2-24/
110 Upvotes

25 comments sorted by

2

u/starblazer13 Feb 28 '19 edited Feb 28 '19

Hmmm not working for me. Can't find Dart: Dev tools in the command palette.... anybody else?

edit: nm... have to have a project running before you can find the dev tools command....

Great tool! Wish there was a dark mode.

5

u/DanTup Feb 28 '19

Wish there was a dark mode.

There actually is, but we don't support spawning it from VS Code yet, in part because VS Code doesn't have an API to tell us whether you're using the Dark or Light theme (and seems unlikely to ever get one).

If we add support, it may have to be a user setting in VS Code to let you choose which theme you want? I've opened https://github.com/Dart-Code/Dart-Code/issues/1496

2

u/DanTup Feb 28 '19

That's right - the DevTools require a debugger to function. If this is a common confusion, we could have the command appear in the palette always and have it just show an error if you try to launch it without a debug session.

1

u/starblazer13 Feb 28 '19

That would definitely help for new VS Flutter users. Wasn't a big deal, but didn't see that small details in the release instructions.

2

u/[deleted] Mar 01 '19

I just wish it logged network requests, like Stetho or Flipper.

3

u/DanTup Mar 01 '19

Someone requested that here:

https://github.com/flutter/devtools/issues/368

I don't know whether it's planned, but it's worth Subscribing to that issue if you're interested in it.

1

u/[deleted] Mar 01 '19

Thanks! Subscribed.

1

u/Eltonomicon Mar 01 '19

1

u/[deleted] Mar 01 '19

Yeah, I even built it on my windows PC, but I couldn't get the flutter plugin to work with my Dio services. Right now I'm using Stetho.

1

u/gadfly361 Feb 28 '19

Do you know if devtools will eventually support clicking on a widget in the browser and having the source code focused in vscode? Is that possible? (This is a feature in intellij and it is really nice)

2

u/DanTup Feb 28 '19

I'm unable to test right now, but I thought it already did. Maybe it's only when you tap the widget on the device (after hitting the Select Widget Mode) then?

If not, do open an issue in the DevTools about it - once it fires an event, we can listen to it in VS Code and navigate there.

2

u/gadfly361 Mar 01 '19

@danTup Yeah, it appears to work if you turn on 'select widget mode'. I will open a ticket suggesting that it also navigates to the source code when clicking on the widget tree in the devtools browser

1

u/gadfly361 Mar 01 '19

@DanTup which repo is the appropriate place to file a ticket for this? Is it https://github.com/flutter/devtools

1

u/DanTup Mar 01 '19

Yep! It'll need work both in DevTools (if not already supported) and the VS Code extension, but the DevTools work will need to come first.

1

u/jwknows Mar 06 '19

It doesn't show the Dart: Dev tools command for me neither. I have a flutter app running in debug mode on a iOS simulator.

1

u/DanTup Mar 07 '19

Please open an issue at https://github.com/Dart-Code/Dart-Code and we'll track it down 👍

1

u/Levelx100 May 23 '19

Any way to launch this with chromium instead of google chrome? I works in chromium but right now if I want to open it I have to Launch it from vs-code get a ProcessException in vs code and then copy the command into my terminal (and wrap the URL in "s) where I have google-chrome aliased to chromium.

Is there any way to alias this for vs-code? or to modify the command to use chromium instead of chrome?

I use mainly Firefox, prefer chromium over chrome on my machine and don't really want to have three browsers installed if I can avoid it

1

u/DanTup May 23 '19

You could try setting the CHROME_EXECUTABLE environment variable to the location of the Chromium executable. I don't know if it'll work, but DevTools is doing the spawning of the browser by using the browser_launcher package and it seems to check this first:

https://github.com/dart-lang/browser_launcher/blob/66215f3b0497cd7794b0a9cd4703437630d5dcc5/lib/src/chrome.dart#L12

1

u/Levelx100 May 24 '19

CHROME_EXECUTABLE

I tried adding that environment variable in both my terminals (bash as well as fish). I also tried replacing google-chrome with chromium in any configuration files related to flutter. Neither of these have worked. Any other ideas by chance?

I suppose it might work if I were to rebuild the browser_launcher package with chomium instead of google chrome however I am not aware of if I would be able to do that.

Worst case scenario I download chrome or launch devtools by copying the command into a shell. Or I avoid using devtools all together, I usually only use it to hide the debug banner anyway.

1

u/DanTup May 24 '19

It's possible if you set it in your terminal but VS Code wasn't launched from there, that it won't have got the variable.

Easiest way to test, is confirm it's set in your terminal, then run pub global run webdev daemon (in your project folder) and see if that changes anything.

If not, you get to some debugging ;-) I would try:

If running that works, then something else is up. If it fails with the same error, then in lib/src/chrome.dart put print(_executable) right before the Process.start call and see whether it got the exe you'd expect.

1

u/CaptainHarris Mar 29 '19

I am very new to all types of programming but I have gotten very used to using vs code. Do you guys think it's worth learning my way around android studio to learn flutter more quickly?

0

u/SionicIon Feb 28 '19

How long will it take for someone to look at my issue on there? The Widget Inspector is blank for me. Tried latest Chrome, and Chrome Beta, both do the same thing. The Widget Inspector is empty. I believe they are there, I have scroll bars and sometimes I do see the widgets but then the list becomes invisible. I've tried starting Dart Dev Tools from entirely new projects using VS Code, via the command line, and Android Studio. It's like a problem with the page rendering.

https://github.com/flutter/devtools/issues/366

1

u/SionicIon Feb 28 '19

Just an update, I tried fiddling around with setting my DPI to 100% and it fixed it. It's just a workaround though. It appears the widget inspector doesn't render on high-DPI displays on Windows 10.

1

u/newnimzo Mar 03 '19

I've landed a fix for the bug. Thanks for the feedback!