Don't use dart.sdkPath in preference to Flutter-shipped version of Dart for a Flutter project
See original GitHub issueHi, I’m getting an issue with the code. I downloaded the example from VSCode running “Flutter: New Project” and it immediately marked as an error a part of code that Android Studio does not. The incriminated part is
floatingActionButton: new FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: new Icon(Icons.add), //this line
)
It can’t be an error because it compiles and runs just fine. Also I get plenty of similar errors in another test project I made, errors I don’t get in Android Studio. Is there a way to solve this? Am I missing something? The debugger works fine.
I’m running VSCode x64 1.25.1 on Windows 10 Pro
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Dart SDK is not configured - Stack Overflow
Open your Android Studio preferences(Command + ',') and go to Languages and Frameworks>Dart . Under the Dart menu, you should be able to...
Read more >[2022] 7 Steps to Fix Dart SDK is not Configured in Flutter
For Mac: Click Android Studio on top -> Preferences -> Languages & Framework -> Dart. Step 4: Checkmark the “Enable Dart support for...
Read more >How to keep multiple versions of Flutter | by Ayu - Medium
In this article, I would like to share my experience on how to keep multiple versions of flutter like Stable or Master at...
Read more >Set up an editor - Flutter documentation
VS Code is a lightweight editor with complete Flutter app execution and debug support. VS Code, latest stable version. Install the Flutter and...
Read more >Get the Dart SDK
Note: The Flutter SDK includes the full Dart SDK, and has Dart's dart command-line interface in its bin folder. Dart tools may send...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No worries, I think you’ve hit a legit issue. Setting
dart.sdkPath
has become more common due to all sorts ofPATH
issues (settingPATH
so that it applies outside of the terminal turns out to be complicated on some OSes) so us using it ahead of the Flutter version is probably a bad idea. It was handy for me in the past for testing, but having them mismatch causes other issues anyway.So, I’m going to use this issue as a task to stop prioritising
dart.sdkPath
over the embedded one. If anyone wants to change the Flutter Dart SDK version (which they almost certainly don’t), they can rig it themselves internally.Thanks for the help debugging; and do shout if you have any other issues!
You should be able to just run
flutter channel dev
and thenflutter upgrade
. See https://github.com/flutter/flutter/wiki/Flutter-build-release-channels(To change back, you can do
flutter channel beta
andflutter upgrade
)