Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run flutter on chrome using visual code editor

How to run flutter app on chrome. I have installed flutter kit and also run flutter channel beta flutter upgrade and also install extension on visual studio code.

like image 487
Pradeep Yadav Avatar asked Jan 11 '20 08:01

Pradeep Yadav


People also ask

Can I use Vscode for Flutter?

Anecdotally, I would say that Visual Studio Code (VS Code) is the most popular IDE in use in the Flutter landscape today.


2 Answers

Just like with flutter mobile create flutter launch configuration, but add the following line: "args": [ "-d", "chrome" ]

{
  // launch.json
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Flutter for web",
      "type": "dart",
      "request": "launch",
      "program": "lib/main.dart",
      "args": [
        "-d",
        "chrome"
      ]
    }
  ]
}
like image 142
Spatz Avatar answered Sep 19 '22 20:09

Spatz


You can write on terminal:

flutter run -d chrome
like image 44
INDIAN GAMER Avatar answered Sep 19 '22 20:09

INDIAN GAMER