Closed sethladd closed 7 years ago
Here is the screen where I'm supposed to set the Dart SDK. It would be fantastic if there was a "use the version from Flutter" so I don't have to hunt down wherever Flutter downloaded the Dart SDK
tldr: I don't know how to set this :(
According to the screenshot Flutter plugin is not installed. IDE has no idea where Flutter SDK is.
With my pull request accepted user will have no chance to get empty 'Dart SDK path' in Dart page if Flutter SDK is set in Flutter page. //cc @pq
Good call. I don't have the Flutter plugin installed. Not sure what to do about that. Maybe there's a search algorithm to find a Dart SDK?
@sethladd: if you have the Flutter plugin installed it will prompt you for a Flutter SDK location (e.g., repo root) and set the Dart SDK for you. You should never have to go to the Dart preference page. (In this case Dart is a detail of Flutter...)
I don't have the Flutter plugin installed
flutter doctor
should yell at you then right?
I just installed the Flutter plugin. I haven't been asked to set my Flutter SDK yet. The IDE is still telling me to set Dart SDK:
(this is after a restart and after I changed the project to be a Flutter project)
Did you create a project or open an existing one?
Opened an existing project.
OK, that's what I'd expect. To fix this, we'd need the Dart plugin to be smarter.
cc @alexander-doroshko
The flow I was describing starts with you:
Opening an existing project skips the second step and so the Dart plugin sees the Dart file and intervenes.
I did:
1) open an existing project 2) install the dart plugin (because IDE told me to) 3) install the flutter plugin (because @pq told me to :)
You forgot:
4) install darcula theme
but really, (1) should have prompted a different
2) install the Flutter plugin (because the IDE told me to)
Yes, ideally, if a user opens a Flutter codebase in IntelliJ for the first time, they should be prompted to install the Flutter plugin. That would be great.
Can you look for flutter.yaml ?
We have logic like that in the Flutter plugin that helps migrate projects that weren't created with the Flutter wizard to having the Flutter module type and so being treated as a Flutter project. It would be awesome to embed similar logic in IntelliJ.
The logic that @alexander-doroshko described that you get from the platform I think would only kick in if flutter.yaml
were opened and I don't know how frequently that happens in practice. Something more comprehensive (like scanning for the existence of that file) would have to happen programmatically in an installed plugin. In theory we could embed this logic into the Dart plugin but I'll defer to @alexander-doroshko about how he feels about that.
Looks like there are no ways to automatically get advertising of the Flutter plugin from the IntelliJ Platform.
Thanks for confirming @alexander-doroshko.
From the other thread it sounds like the best we could do is add some awareness to the Dart plugin. Something to add to the general discussion around how these plugins should interact.
Another "getting started" flow to consider. As @sethladd suggests:
Yes, ideally, if a user opens a Flutter codebase in IntelliJ for the first time, they should be prompted to install the Flutter plugin. That would be great.
FYI @mit-mit
That is the change I landed to IntelliJ, I believe: https://github.com/JetBrains/intellij-community/pull/496
Ah, right. That's a great improvement. 👍
Closing in favor of revisiting (if needed) once we dig deeper into the getting started flow.
@sethladd is your problem solved? If yes then please share your solution.
Sorry, it's been a long time. Are you still experiencing the issue?
From my expectations, when you install the Flutter plugin, it should auto-detect the Dart SDK which is part of your Flutter SDK.
@mit-mit might be able to confirm that expectation?
Yup, I am still facing this problem. My Intellij IDEA version is 2017.2.3 and flutter plugin is installed in it already. I am facing this problem while trying to open the flutter gallery example available in the flutter directory.
Would you be willing to open a new bug, with screenshots? Thanks!
I am facing this problem while trying to open the flutter gallery example available in the flutter directory.
We do test that w/ each release but it's possible it's regressed (or, you're seeing something more specific to your setup). As Seth said, can you file a separate bug? Thanks!
Sure, I will create a separate issue.
I'm facing this issue as well
The solution:
git clone -b beta https://github.com/flutter/flutter.git
I can confirm that this is still an issue for version 2018.1.2
I had the same problem. Now I solved.
You should set Preferences -> Language and Framework -> Flutter -> Flutter SDK Path .
Your Dart SDK is inside the Flutter directory. My Flutter directory was inside /opt/
hence, my dart sdk path = /opt/flutter/bin/cache/dart-sdk
select the path from flutter sdk folder flutter>bin>cache>dart-sdk
@iamonuwa Thanks man, that worked for me.
Download the dart SDK form here Extract the zip in a specfic folder Locate the folder in Intellij IDEA
I had the same problem after importing a flutter project from git. These are the steps to solve the problem.
File->Settings->Language & Framework->Flutter Choose flutter SDK path: the first time we install flutter, we choose the location where the flutter should be installed. Choose this location. Click OK and the android studio will refresh. Carry on if the problem is solved. If you are still stuck with the error. Goto this link and install Dart. Goto the same place in settings, ..Language & Framework->Dart and chose the SDK location. This solved the issues for me. take from: https://stackoverflow.com/a/49684442/4799284
it is in this path Flutter_SDK\bin\cache\dart-sdk\bin
it is in this path Flutter_SDK\bin\cache\dart-sdk\bin
Yes, it is. You can also download it from Dart Achive, but this does not contain libraries like meta.
File->Setting->Language & Framework->flutter choose Flutter SDK path (where you Downloaded the flutter plugin, choose flutter folder). It ill work for sure.
Guys, the solution is 👍 1- download flutter from the link https://flutter.dev/docs/get-started/install/windows#get-the-flutter-sdk 2- Extract the zip file in a specific path. 3- Go to Android studio ==> settings ==> Flutter sdk path, update it with a new path you created.
then you can get dependencies automatically to install it.
select the path from flutter sdk folder flutter>bin>cache>dart-sdk
thank you brother you save me time
Encountered this with the Dart and Flutter plugins installed before opening an existing flutter project.
IntelliJ IDEA 2021.1 (Community Edition) Build #IC-211.6693.111, built on April 6, 2021 Runtime version: 11.0.10+9-b1341.35 amd64 VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Non-Bundled Plugins: Dart (211.6693.108), io.flutter (55.1.5) Kotlin: 211-1.4.32-release-IJ6693.72
We shouldn't have to ask users to configure the Dart SDK if they have opened a Flutter project. The version of Flutter bundles/downloads a version of the Dart SDK. No further configuration should be required. Asking a user to further configure their IDE increases the chances of them using the wrong Dart SDK.
Here's a screenshot of my IDE, immediately after restarting after installing the Dart plugin: