How to enable Flutter hot reload in VS Code?

Viewed 35

Scenario

I'm working through the base counter app (after flutter create)

Expected Functionality

I want to enable hot reload in VS Code:

1. increase the count
2. change the primary color + save file
3.1 see the color change
3.2 see the count stay the same (preserving state)

Actual Behavior

In all cases (saving, hitting r(R) in the console, even hitting the lightning icon) I get a Restarted application in Xms and a hot restart.

1. increase the count
2. change the primary color + save file
3.1 color changes
3.2 count is reset to 0 (state is lost)

What I tried

  • switching between manual and automatic save settings
  • setting dart.flutterHotReloadOnSave to all
  • setting dart.hotReloadOnSave to all
  • launching the app in debug and run modes (ctrl+F5 and F5)

My setup

  • Flutter v3.3.2
  • VS Code v1.71
  • Flutter extension v3.48.0
  • Dart extension v3.48.3
0 Answers
Related