Dart-code: flutter "toggle debug paint" command

Created on 20 Jul 2017  ·  5Comments  ·  Source: Dart-Code/Dart-Code

Default flutter app template has the following comment:

// Invoke "debug paint" (press "p" in the console where you
// ran "flutter run", or select "Toggle Debug Paint" from the
// Flutter tool window in IntelliJ) to see the wireframe for
// each widget.

It would be nice if Dart-Code would support "debug paint" as well. There are more commands that flutter run supports, but this was the most helpful in my opinion. And "full restart": #368.

in debugger in flutter is enhancement

Most helpful comment

I've added all of the commands I could find in the intelliJ file, will be included in v2.3 (with the exception of opening Observatory timeline, that may or may not be included in 2.3).

All 5 comments

@devoncarew @eseidelGoogle Is this command available via flutter run --machine? I can't see it listed on the daemon page though there is talk of calling service extensions - is it one of them? If so, where can I find the info? (I had a quick search through atom-flutter source but can't see anything that looks like this).

@DanTup, the atom-flutter sources have not been maintained - I would not look to them for examples. The IntelliJ sources (Flutter related) are here: https://github.com/flutter/flutter-intellij.

For this, we're calling a service extension - contributed by the flutter runtime - called ext.flutter.debugPaint (https://github.com/flutter/flutter-intellij/blob/210cec052c4ed3a5f4fb77e2d58a62bfdc0d800f/src/io/flutter/view/FlutterView.java#L167).

And specifically, we're using the daemon API to proxy the service extension call (app.callServiceExtension, https://github.com/flutter/flutter-intellij/blob/master/src/io/flutter/run/daemon/DaemonApi.java#L84).

Hope that helps -

@devoncarew Perfect, thanks! Are there any docs on these service extensions, or is the IntelliJ source the best place to see everything available?

I've added all of the commands I could find in the intelliJ file, will be included in v2.3 (with the exception of opening Observatory timeline, that may or may not be included in 2.3).

No docs as such; the IntelliJ sources will be the best system of record for a bit. You can also skim the flutter repo code, and you should be able to get a list of service protocol extensions from the protocol.

I've added all of the commands I could find in the intelliJ file

🎉

Was this page helpful?
0 / 5 - 0 ratings