Search code examples
flutterflutter-webflutter-test

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.


Solution

  • 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"
          ]
        }
      ]
    }