Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hot Restart (previously Full restart) in Flutter VS Code whilst debugging

Whilst running my app using flutter run in the console I can press 'r' to do a reload and press 'R' to do a reload and restart. Is there a way to do this whilst debugging in VS Code? Saving a file causes a hot reload but I can't figure out a way to do a full restart.

Edit

This is a little bit different to the hot reload option so I don't think this is a duplicate. This question regards performing a full restart of the application without reinstalling it. This is possible by pressing a capital R in the console, as opposed to pressing a lowercase r in the console which would perform a hot reload.

like image 636
atreeon Avatar asked May 18 '18 12:05

atreeon


People also ask

How do you hot restart a Flutter in Vscode?

To perform a hot restart, run the Flutter: Hot Restart command from the Command Palette, or press Ctrl + F5 .

How do I completely restart my Flutter?

When debugging you can press Ctrl + F5 for a full restart, or you can run the Flutter: Full Restart command from the VS Code's command palette ( Ctrl + Shift + P or Cmd + Shift + P for macOS).


2 Answers

When debugging you can press Ctrl+F5 for a full restart, or you can run the Flutter: Full Restart command from the VS Code's command palette (Ctrl+Shift+P or Cmd+Shift+P for macOS).

Note: In the next version (v2.13.0, which there's a beta of available) "Full Restart" has been renamed to "Hot Restart" to better reflect how it works (this is happening across the other Flutter tools and docs too).

Related info:

  • Flutter VS Code docs
  • Dart Code keybindings
  • Dart Code debugging commands
like image 121
Danny Tuppeny Avatar answered Nov 15 '22 19:11

Danny Tuppeny


The chosen answer wasn't working for me with Flutter 1.2.1 so I used this solution:

  1. get the Flutter extension
  2. search for dart.flutterDebuggerRestartBehaviour in VS Code settings and set it to hotRestart
  3. start the debugger (F5) and click the restart button when you want to hot restart:

    enter image description here

like image 34
galki Avatar answered Nov 15 '22 19:11

galki