Convert Flutter Mobile Application Into Web Just By Using One Command.

samyukta gurram
3 min readJun 18, 2021

Hey, you!…How are you? I hope you are doing good in this pandemic🤞. Hmmm….Okay! I know you are bit excited to see, how can we convert existing mobile application into web just by using one command…right? Okay! I won't let you wait😃.

So, if you are new to the flutter, I recommend you to see my previous story and if you are already have some basic knowledge on flutter then you are on the right path😉.

Create your mobile application:

Create your own mobile application or if you already have any existing application you can use it or simply you can clone it from here (its just a sample increment application).

Setup:

Flutter version should be 1.5.4 or higher & dart 2.3

  1. If you want to use latest version of flutter SDK from beta channel and enable web support .
flutter channel beta
flutter upgrade
flutter pub global activate webdev

2. Now, you can see required dependencies are getting installed globally for web support and the current version is 2.7.2

If flutter upgrade fails sometimes, then try to run below command:

flutter packages pub global run webdev serve

3. And now we are almost a bit closer to see the output and it’s time to enable web support.

flutter config --enable-web

Note: You are supposed to follow the above steps only for the first time when you are converting your application into web.

From next time, when you want to convert existing application into web then simply start doing from below steps.

After running the command, you should able to see web folder created in your directory.

 flutter create .

Output:

Firstly, check for the devices, and run below commands:

flutter devices
flutter run -d [chrome] (your favorite browser)

Final Output:

For your understanding , let’s do some changes and hot reload it …

Thank you…🙌 If you have any queries please do comment below. And that’s it…😊! Happy coding..!👍

--

--