Development and debugging of vscode configuration flutter

Time:2021-7-21

Today’s content is not much, mainly about how to configure and debug some of the holes of the flitter, and record them.

The dart code plug-in has been installed after the official website tutorial. Previously, I used the command line after the flutter emulator to execute the flutter run. Every time I update the code, I need r overload or R restart. Later online search, you can detect changes in the file automatically overload.

First, use command + P to call out the command, and then have a flitter emulator to start the emulator in the debugging tool. After the simulator starts, debug the command to start debugging. For the first time, you will enter a URI or port port with a default value of 8102.

🔥  To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:8102/
For a more detailed help message, press "h". To quit, press "q".
Lost connection to device.

After typing, you can start the program in the debugger instead of the command line. After startup, the interface is as follows:

After that, you need to bind a shortcut key. The default is hot reload. In this mode, you can keep your application status, but now I need hot restart. This function is not available in the debugging toolbar by default. The green refresh button can only be hot reload. For details, please refer toThis postIn a word, vscode does not support more debug bar buttons at present. It can only be implemented with commands, but plug-in developers have implemented this function. There is hotreload in the binding shortcut. Just add a hotrestart.

Add in keybinding.json:

{
    "key": "ctrl+c",
    "command": "flutter.hotRestart",
}