Reputation: 6087
I've just started playing with Flutter in VSCode. I also installed the Dart Plugin.
Running the demo app I read in the terminal
Is this the only way to hot-reload the app? I mean I should always keep the terminal open and focus on it to type "r" in order to reload my views? Isn't there a shortcut directly from VSCode?
Upvotes: 63
Views: 106895
Reputation: 437
You can do this steps
Open Settings.
Paste this text > dart.flutterHotReloadOnSave on the settings search box.
And change value from "Manual" to "All"
Upvotes: 0
Reputation: 2542
For 2024, this solution worked.
Steps
dart.flutterHotReloadOnSave
on the settings search box.Note: Make sure the app is running on debug mode. Hot-Reload not worked on release mode.
Upvotes: 69
Reputation: 21
If you want enabled hot reload in flutter project you need to enable auto save in file>autosave in vscod IDE
Upvotes: 0
Reputation: 3347
If you run your flutter project from the terminal you will have to manually press r
to do a hot reload.
Therefore use the Run and Debug
option in the VS Code to test your project.
Upvotes: 1
Reputation: 330
if flutter and dart extensions already installed on vscode
Set from manual to All
Upvotes: 3
Reputation: 6174
===== Aug 2022 UPDATE =====
v3.42 and above: You can enable hot reload on autosave in the latest version by setting Flutter Hot Reload On Save to allIfDirty
in your VSCode settings.
===== Old Versions (Early 2022 and below) =====
v3.41 and below: You can enable hot reload on autosave in the latest version by setting Flutter Hot Reload On Save
to always
in your VSCode settings.
v3.19 only: They disabled hot reload on autosave completely.
v3.18 and below: The extension hot reloads automatically when auto saving.
Upvotes: 2
Reputation: 2331
Select ▷ then "Run without Debugging" -> You can now use ⌘S on Mac to ⚡ Hot Reload ⚡
Upvotes: 1
Reputation: 299
You need to run Flutter app from VS Code's built-in debugger not VS Code's terminal.
Upvotes: 3
Reputation: 4258
on Mac select
Run without Debugging or Shift+f5
you will see this at top select the electric icon for Hot Reload.
After doing some changes save it. It will auto reflect changes.
Upvotes: 3
Reputation: 629
VSCode debug -> start debuging
, make a change and try, That's what you want.
Upvotes: 10
Reputation: 277717
There's an extension for that. Called Dart Code
and another one named Flutter Code
They will detect that your project is a Dart/Flutter project. And allows you to debug it + hot reload using f5.
Upvotes: 47
Reputation: 643
open the Debug sidebar from VSCode and use it
then when you save, it will hot reload and apply the changes you make that is what working with me
Upvotes: 5
Reputation: 303
If you like to hot reload your app with a keybinding better than Ctrl+Shift+F5, just change the Debug: Restart to Ctrl+S, so whenever you trigger the the Ctrl+S the app will first save your changes according to the workbench.action.files.save and afterwards restart the app (=hot reload, it is the green circle you see in the debugbar).
Keybindings for VS Code:
Upvotes: 18
Reputation: 603
You may encounter problems with Hot Reload due to VS Code issues like this, which is relevant while writing this answer.
The most convincing way I see to do it without downgrading, updating to Insiders builds and/or loosing dev speed is to use the green restart/reload button in the VS Code run widget or Ctrl+Shift+F5
shortcut, but this option may be inacceptable for projects with trickier navigation and few different views.
Upvotes: 0
Reputation: 307
i dont know why but my vscode hot reloading not work if you have this problem you can use ctrl + f5
to refresh app.
hope to work for developers that hot reloading not work for them.
Upvotes: 1
Reputation: 11
I have both extensions and VSCode is set to Hot Reload once a document is saved. The only time I can reload my app is by stopping and restarting my debugger
Upvotes: 1
Reputation: 1461
use the green reload button to hot reload the app in VS Code
Upvotes: 2
Reputation: 2601
No idea why F5 does not hot reload for me :(
But, you can map the -
Flutter: Hot Reload
command to whatever key combo floats your boat via -
Preferences > Keyboard ShortCuts
as in this screenshot -
Upvotes: 6
Reputation: 11
In VS once installed Dart + Flutter extension, 2 options to hot reload 1) Use combo keys Command + Shift + F5. 2) Save the file by use combo keys Command + S
Upvotes: 1
Reputation: 671
yes Here is the plugin Dart Code for VS CODE
https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code
here is official doc for VsCode flutter
https://flutter.io/get-started/editor/#vscode
Upvotes: 1