How to set dart & flutter to default when I'm buliding flutter projects

1,274

Solution 1

For VSCode you need a launch configuration

If you don't have the following file, create one:

.vscode/launch.json

With contents of:

 {
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Flutter",
      "type": "dart",
      "request": "launch",
      "program": "${workspaceFolder}/main.dart"
    }
  ]
}

Just make sure the program is pointing to your main dart file that has runApp in it

Solution 2

{
    "configurations": [
    {
        "name": "Flutter",
        "type": "dart",
        "request": "launch",
        "program": "lib/main.dart"
    }
    ]
}
Share:
1,274
Vincent
Author by

Vincent

Live in a planet 1.5 billion light years from Earth.

Updated on December 08, 2022

Comments

  • Vincent
    Vincent over 1 year

    I'm using vs code to create and build a flutter project.

    But every time I press F5 to build, vs code always asks me to select the environment. It's very annoying.

    How to set dart & flutter to default when I'm buliding flutter projects.

    enter image description here