简体   繁体   中英

Flutter: changing dart SDK

I want to change my sdk version from 2.16.2 to 2.17.1 while I'm using android studio (for a single project only)

could someone please help me with this issue?

Thanks

Download the respective Dart package( https://dart.dev/get-dart/archive ) or the Flutter SDK ( https://docs.flutter.dev/development/tools/sdk/releases ) [in your case version 3.0.1) from the archive for your operating system.

Once downloaded, open your project in Android Studio and go to

In Windows

File > Settings > Languages & Frameworks > Flutter

In Mac

Preferences > Languages & Frameworks > Flutter

Change the path of Flutter SDK to the downloaded one. Or you can do the same for the Dart option in the same settings pane.

But always keep in mind that to change the Dart version which is compatible with the flutter version. So it is better to change the Flutter SDK path rather than Dart.

Once everything is done, restart the IDE.

Note: This method will only apply the changed version for the current project alone. Not even the terminal for the project won't be reflected, as the path would have been set for some other versions.

From File>Settings>Languages&Frameworks>Dart, Enable Dart support for the project, write dart sdk path在此处输入图像描述

In Android studio : Go to settings => plugin => dart (update dart)

And In terminal use command : flutter upgrade

I'd use fvm to manage the flutter versions of the projects that need to be pinned to something before stable . You'll have to figure out which Dart is in each Flutter release, but that's a minor issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM