Reading Time: 4 minutes
Today I’m going to show you how to open a Flutter project in VSCode to work in this environment.
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen.png?resize=333%2C195&ssl=1)
First, let’s install the Flutter SDK on our PC:
- Go to the official website https://docs.flutter.dev/get-started/install/windows
- Choose the corresponding installation:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-1.png?resize=787%2C213&ssl=1)
- Next, extract the flutter folder to the directory where you want to install it (in my case C:/flutter):
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-2.png?resize=254%2C169&ssl=1)
- Once extracted, we need to create an environment variable to be able to run flutter from the terminal. To do this, go to the start search bar and type env.
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-3.png?resize=503%2C353&ssl=1)
- Open Edit the system environment variables.
- Click on Environment Variables…
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-4.png?resize=383%2C130&ssl=1)
- Search for the Path variable, if it doesn’t exist, click on New… and create it.
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-5.png?resize=435%2C145&ssl=1)
- In my case, it already exists because the Java directory is added:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-6.png?resize=612%2C33&ssl=1)
- If it exists, edit it and click New:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-7.png?resize=127%2C92&ssl=1)
- Now, add the path \flutter\bin. In my case, it is C:\flutter\bin
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-8.png?resize=502%2C109&ssl=1)
- Click OK in all windows.
- Now open CMD or Windows console and test if it works by typing flutter doctor.
flutter doctor
If it works, you will see this:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-9.png?resize=900%2C625&ssl=1)
Check for any errors and execute what it indicates:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-10.png?resize=900%2C280&ssl=1)
In my case, I need to install this: “path/to/sdkmanager –install “cmdline-tools;latest””. To execute it, we need to find the Android SDK path. If we don’t have it, we’ll need to install the Android SDK (https://developer.android.com/studio)
In my case, the path is: C:\Users\ismae\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat. To find the path, it is: C:\Users\{username}\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat
Execute the command:
C:\Users\ismae\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat --install "cmdline-tools;latest"
If this option doesn’t work, you caninstall the Command-line Tools through the following steps:
- Open Android Studio and go to Tools – SDK Manager – SDK Tools – Android SDK Command-line Tools – Install
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-11.png?resize=180%2C277&ssl=1)
Open SDK Tools
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-13.png?resize=242%2C65&ssl=1)
And install the Command line Tools
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-14.png?resize=900%2C76&ssl=1)
Click Apply
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-15.png?resize=900%2C361&ssl=1)
Once installed, click Finish and OK
Now, run Flutter Doctor again to check if there are any errors:
flutter doctor
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-17.png?resize=581%2C250&ssl=1)
Now you can execute Flutter commands:
- To test the project: flutter run
flutter run
If you don’t have a connected device with USB debugging enabled (https://devcodelight.com/habilitar-depuracion-usb-opciones-para-desarrollador-en-tu-dispositivo-android/), you will be prompted to run it on the web:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-18.png?resize=709%2C80&ssl=1)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-19.png?resize=666%2C92&ssl=1)
It may take some time as the project is being compiled.
Other useful commands:
- flutter upgrade (update Flutter)
You can also run commands from the VS Code command palette
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-20.png?resize=478%2C85&ssl=1)
If you type “Flutter” in the command palette, the following options will appear:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/11/imagen-21.png?resize=521%2C348&ssl=1)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2023/07/cropped-light_logo-5.png?resize=100%2C100&ssl=1)