๐Ÿš€ Enable Hot Reload in Flutter Web Beta! (Step-by-Step) ๐Ÿ”ฅ

Manoj KulkarniManoj Kulkarni
2 min read

Introduction:

In this article, we will explore how to enable hot reload for Flutter web in its beta release, enhancing the development process by allowing real-time updates without restarting the application.

Note:

If you want to learn the difference between hot reload and hot restart, watch this video.

Steps:

  • Open up terminal and switch to beta channel using below command.

      flutter channel beta
    
  • Execute below command to get the latest update available on beta channel.

      flutter upgrade
    
  • Make sure you have the version 3.31 or above installed on your machine.

  • Open up Flutter project in VS Code.

  • Now run the Flutter project by executing below command in terminal.

      flutter run -d chrome --web-experimental-hot-reload
    
  • --web experimental-hot-reload is the new flag that we need to add to enable hot reload in beta for Flutter web.

  • After running the application, make a UI change and hit r in terminal to reload the change in Flutter web application.

  • Or just add the below configuration in launch.json file and hit F5 to run the application.

          {
                  "name": "Flutter for web (hot reloadable)",
                  "type": "dart",
                  "request": "launch",
                  "program": "lib/main.dart",
                  "args": [
                    "-d",
                    "chrome",
                    "--web-experimental-hot-reload",
                  ]
              }
    
  • Your Flutter application is now running with hot reload enabled for Flutter web in beta. This means faster iterations and smoother development process.

I have also created a YouTube video regarding this topic, so if you would like to watch a video tutorial, then please go to https://youtu.be/nVRJthgXyss.

Conclusion:

In conclusion, enabling hot reload for Flutter web in the beta release significantly enhances the development experience by allowing developers to see changes in real-time without restarting the application. By following the outlined steps, developers can efficiently implement this feature, leading to a more streamlined and productive workflow. This advancement in Flutter web development is a testament to the continuous improvements being made to support web applications, making it easier for developers to build and iterate on their projects.I hope this article helped!

Happy coding!

0
Subscribe to my newsletter

Read articles from Manoj Kulkarni directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Manoj Kulkarni
Manoj Kulkarni

I am programmer, blogger and foodie. I just love computers, coding and technical things. I spend most of my free time working on building my skill set by reading technical articles about new technologies or books on software development and try to keep my self updated as much as I can.