As a general rule, if the modified code is downstream of the root widget’s build method, then hot reload behaves as expected. However, if the modified code won’t be re-executed as a result of rebuilding the widget tree, then you won’t see its effects after hot reload
What is the difference between hot reload, hot restart, and full restart?
-
Hot reload loads code changes into the VM and re-builds the widget tree, preserving the app state; it doesn’t rerun
main()
orinitState()
. (⌘\
in Intellij and Android Studio,⌃F5
in VSCode) -
Hot restart loads code changes into the VM, and restarts the Flutter app, losing the app state. (
⇧⌘\
in IntelliJ and Android Studio,⇧⌘F5
in VSCode) - Full restart restarts the iOS, Android, or web app. This takes longer because it also recompiles the Java / Kotlin / ObjC / Swift code. On the web, it also restarts the Dart Development Compiler. There is no specific keyboard shortcut for this; you need to stop and start the run configuration.
Flutter web currently supports hot restart but not hot reload.