Skip to main content

Set up Flutter using VS Code

note

This guide was tested for Windows only.

Prerequisites

  • Visual Studio Code 1.86 or later
  • Git for Windows 2.27 or later to manage source code.

For more details, visit Flutter documentation.

Step 1: Install Flutter extension on VSCode

Step 2: Prompt VSCode to install Flutter

  1. In VS Code, open the Command Palette by pressing Control + Shift + P.

  2. In the Command Palette, type flutter.

  3. Select Flutter: New Project.

  4. VS Code prompts you to locate the Flutter SDK on your computer.

    • If Git is set up, it will ask you to pick a folder to Clone Flutter
    warning

    Don't use a directory that meets one or both of the following conditions:

    • The path contains special characters or spaces.

    • The path requires elevated privileges.

    As an example, C:\Program Files fails both conditions.

    • If you have the Flutter SDK installed, click Locate SDK.

    • If you do not have the Flutter SDK installed, click Download SDK.

    note

    This option sends you the Flutter install page if you have not installed Git for Windows as directed in the development tools prerequisites.

When prompted Which Flutter template?, ignore it by pressing Esc.

Step 3: Add Flutter SDK to PATH

When the Flutter install succeeds, VS Code displays this pop-up notification:

Do you want to add the Flutter SDK to PATH so it's accessible in external terminals?
  • Click Add SDK to PATH.

When successful, a notification displays:

The Flutter SDK was added to your PATH

Try flutter --version to check if it's successfully installed yet.

Troubleshooting

If it does not work, add the path mannually.

  1. Copy your path to directory Flutter SDK\flutter\bin
  2. Open Edit the system environment variables and do the following steps: img img img
  3. Paste the copied path then click OK.
tip

To verify if you successfully installed FlutterSDK, run command:

Command Prompt
flutter --version

Step 4: Create your first app

In a designated folder, run this command:

flutter create <app_name>

Resources

  1. Flutter Documentation
  2. Youtube Tutorial