2024年7月1日 11:29
What is the difference between hot reload and hot restart?
In Flutter, Hot Reload is the easiest and quickest way to make any changes, create UIs, fix bugs, and add features to the app. A Hot Reload performs all these changes rapidly and makes changes in the UI without disturbing the entire app.
Here’s how to perform Hot Reload:
- Run the Flutter editor using command prompt or editor.
- Once the project is created, you can use debug mode and perform hot reload
- In windows, use “ctrl+\” to perform hot reload or using the button. For Mac devices, you can use “cmd+s” to perform hot reload. If you’re using the command prompt enter ‘r’ to run.
A Hot Restart is different from Hot Reload as it demolishes the preserved states of the app and compiles the code from scratch.
Hot Restart takes more time as compared to Hot Reload but takes less time than restart function.
Here’s how to perform Hot Restart:
- Run the editor using command prompt
- Make some changes and run the hot restart
- To start hot restart use the hot reload button or press ctrl+shift+.