Go-flutter: Printscreen shortcut

Created on 20 Mar 2020  路  13Comments  路  Source: go-flutter-desktop/go-flutter

Is your feature request related to a problem? No

A clear and concise description of what the problem is.
What about a shortcut that prints the hover application screen? Android emulator has this feature and I think it's very useful.

Describe the feature you'd like

Something like Alt + PrtScr

A clear and concise description of what you want to happen.

enhancement hover question

All 13 comments

Would you like it to only be available in debug or always?

@jld3103 I didn't know that there's a hover debug mode, or you are referring to flutter's debug mode?

Yes

I don't see any problem the print shortcut works for non debug profile too, but if you want to restrict only for debug, I'm okay with that :)

It's already available in the flutter toolchain!

flutter screenshot --observatory-uri=http://127.0.0.1:50300/XXXXX --type=rasterizer

$ flutter screenshot --helpTake a screenshot from a connected device.

Usage: flutter screenshot [arguments]
-h, --help                      Print this usage information.
-o, --out=<path/to/file>        Location to write the screenshot.
    --observatory-uri=<URI>     The observatory URI to connect to.
                                This is required when --type is
                                "skia" or "rasterizer".
                                To find the observatory URI, use
                                "flutter run" and look for "An
                                Observatory ... is available at"
                                in the output.

    --type=<type>               The type of screenshot to
                                retrieve.

          [device] (default)    Delegate to the device's native
                                screenshot capabilities. This
                                screenshots the entire screen
                                currently being displayed
                                (including content not rendered by
                                Flutter, like the device status
                                bar).
          [rasterizer]          Render the Flutter app using the
                                rasterizer. Requires
                                --observatory-uri
          [skia]                Render the Flutter app as a Skia
                                picture. Requires
                                --observatory-uri

Run "flutter help" to see global options.

image

Thank you very much @pchampio, It works!
If there was any way of getting this XXXXX easily, I could make some shortcut for hover.el to take the screenshot :thinking: :pensive:

Haha, I'm working on this at the moment^^

Thanks! :crossed_fingers:

I have removed the auth-code from the observatory URL. engine/switches.h This wasn't an option before. No more XXXXX at the end of the url.

I've also enable enable-service-port-fallback engine/switches.h, this way, multiple hover run can be launched without having to use the hover run --observatory-port flag.

In the context of hover.el, It's up to you to provide an --observatory-port that isn't already used, relying only on the default port will cause issues when multiple user are running hover run.

image

fixed in the latest version of hover.
go get -u github.com/go-flutter-desktop/hover

Uow, nice!
I'll sure implement this :D
Thanks for your help @pchampio

@ericdallo could you read https://github.com/go-flutter-desktop/go-flutter/issues/129#issuecomment-601852948
I'll like your opinion, and how are you performing hot reload? (manually or on save, if on save, are you sending 'r' key-presses into the hover proc)

@pchampio, hover.el has the option to manually input commands like r or R, but also allows keybindings to do that, like in this example. It has the feature that on file save, it triggers auto-reload(sending the r command to hover background process).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pauldemarco picture pauldemarco  路  7Comments

inaxium picture inaxium  路  4Comments

MathiasDeWeerdt picture MathiasDeWeerdt  路  4Comments

monkeyWie picture monkeyWie  路  7Comments

pchampio picture pchampio  路  6Comments