VSCodeHow to write Flutter and Hot Reload automatically respond? The following article will introduce to you how to configure VSCode. I hope it will be helpful to you!
I have been using VSCode to write Flutter.
I didn’t set up VSCode much before, but when I was writing Flutter, there was a function that I was very comfortable using, that is, Once I rewrote the code, VSCode would automatically Hot Reload is performed.
But after I upgraded VSCode, this function disappeared inexplicably. You must manually execute cmd s
before executing Hot Reload. [Recommended study: "vscode tutorial"]
It was obviously automatic before, but now it is manual, but I am not used to it, so I decided to check how to change this configuration.
After a fierce search on the Internet, I finally found the configuration method, and now I share it:
1. Open the VSCode settings:
2. Search dart.flutterHotReloadOnSave
in the input box. We can see the default configuration manual at this time, only reload for manual saves, If and only when saving manually, start reload
manual with always:
Let’s take a gif to see the effect. I used the source code of Flukit. After modifying the title of the AppBar and undoing the modification,it was completed without saving or other keyboard operations. Hot Reload function:
At this point, theHot Reload automatic response function I am used to is back.
Reference Documenthttps://stackoverflow.com/questions/49210769/vscode-hot-reload-for-flutterSummary
As the saying goes, "A is like honey, B is like arsenic".
I am used to this automatic response to Hot Reload, but some people are more accustomed to saving and then Hot Reloading, because it may just change the logic to trigger Hot Reloading, and not everyone likes it, and more or less Consume performance. Although Android kids have suggested that I use Android Studio for Flutter development, I'm still not used to it. I prefer VSCode, which is powerful enough and light enough at the same time. I have always been used to writing Flutter through VSCode, but I use Android Studio when building apk or converting JSON to Model. See you next time. For more programming related knowledge, please visit:Programming Video! !
The above is the detailed content of How to configure VSCode to realize automatic response of Flutter and Hot Reload!. For more information, please follow other related articles on the PHP Chinese website!