Can't run my Flutter app using CTRL + F5 in VSCode after update

Viewed 661

I have a quick question. It seems after update of VSCode i can't run my flutter app using CTRL + F5 in VSCode. Why does it happen? It just says Install extension. Here is a screenshot:

enter image description here

Note: However i can run my app using terminal

5 Answers

you have to install the extensions of flutter and dart to word. There is an icon on the left side with 4 boxes press that and search and install dart and flutter extensions

Click in main.dart file, and then press F5, worked for me.

It happens quite a lot. When a new update is installed in my Linux machine, I'd restart the VSCode, and then it'd work as expected.

  1. Create a folder named .vscode, if one doesn't exist. (note the dot at the beginning of the name.)
  2. Create a file inside that folder named launch.json.
  3. Paste the following in that file:
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Flutter",
      "request": "launch",
      "type": "dart",
      "flutterMode": "debug"
    }
  ]
}
  1. ???
  2. Profit.

That is what I did and it worked: First, install the dart extension. Then try to hit f5 key: the VS Code will automatically create a launch.json file for you. Then in the bottom right corner click in "Add configuration > {} Dart: Launch" and insert the name of your program - in my case main.dart. My final launch.json file look like this:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Dart",
            "type": "dart",
            "request": "launch",
            "program": "main.dart"
        },
        {
            "name": "Dart & Flutter",
            "request": "launch",
            "type": "dart"
        }
    ]
}

Hope it was helpful!

Related