3

I am a C# developer, but have been tasked with developing a Flutter app, and I am discovering I have no idea what I am doing. I have a copy of Visual Studio Code and have installed the Flutter SDK, but they aren't working together. The Dart and Flutter extensions are installed, but when I CTRL+SHIFT P and select Flutter: New Project, the prompt disappears and I find myself with nothing changed on the screen. Earlier, I was getting an error that VSCode could not find my SDK.

I am going nuts. Can someone tell me where to start debugging this problem?

4
  • Have you already looked through the documentation of the App/extension or similar, have any other users had the problem before? Commented Aug 7, 2018 at 19:56
  • Hi Kay, Thanks for the response! I have reviewed the documentation for the extensions, but there's nothing there to indicate how to troubleshoot such a problem. I am sure this is something simple, but the entire environment is new to me, and I am not even sure where to start. I am fumbling around right now, Googling and reading everything I can, but so far no luck. Commented Aug 7, 2018 at 20:13
  • Can you run flutter doctor in your terminal ? Commented Aug 7, 2018 at 20:22
  • Hi, Remi. I am now at home and can't check, BUT I discovered something! I set up VSCode and Flutter exactly the same, and it worked like a charm. I still don't know what the heck I'm doing with the IDE or Flutter, but the IDE seems to be working as expected now. I work in a corporate environment with no admin rights (anymore), and I'm thinking maybe my lack of admin rights or possibly a policy was pushed that is causing me a problem. Commented Aug 7, 2018 at 22:51

4 Answers 4

4

Seems that you don't have the SDK installed. Navigate to the View option on vs code then select Command Palette.

type the word flutter in the palette; it should give you a list of commands, for instance, creating a new project and flutter doctor.

Select either Flutter: Run flutter doctor of Flutter: run new project

You will get an option at the bottom|right side of vs code to select installation folder for SDK (if you don't have it). You will then be prompted with Project name and location.

To run your sample project, you can use flutter run command.

Sign up to request clarification or add additional context in comments.

Comments

3

VS Studio is looking for flutter in predefined folders as indicated in the "View Logs" button. To fix this, Add the flutter\bin folder in your environment variable.

In Windows, right-click "This PC" -> "Properties" -> "Advanced System Settings" -> In "Advanced" Tab, click on "Environment Variables", In "System Variables" section select "Path"

Next click "Edit", click "New" and put the location of the bin folder where flutter is installed.

Restart VS Studio, and re-run flutter doctor.

Comments

2

If you're running Flutter: New Project and then seeing nothing at all, then this is certainly a bug in the extension. It's supposed to prompt you for a project name and location.

If you can still reproduce this, please raise a bug on GitHub and if possible attach an Extension log. There may also be useful information in the dev console (Help -> Toggle Developer Tools).

Comments

2

Flutter setup for VSCode windows

  1. You Need to download flutter libraries either from flutter or git a. From flutter https://storage.googleapis.com/flutter_infra/releases/stable/windows/flutter_windows_v1.12.13+hotfix.9-stable.zip b. From git clone (make sure git is installed in your system) C:\src>git clone https://github.com/flutter/flutter.git -b stable

  2. Extract or clone flutter libraries in following directory C:\flutter

  3. Add a new environment veritable path C:\flutter\bin
  4. Run flutter version to check flutter installed correctly
  5. Install VSCode
  6. Install Flutter and Dark extensions in VSCode
  7. Press Ctrl + Shift + P to open command palette. Type in the search bar Flutter and click on Flutter: New Project. It will create a demo project.
  8. Run flutter to run demo project

Note - You may need to install android studio as it will set android SDK and emulator

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.