Can I upgrade or downgrade flutter sdk to a specific version? - flutter

I'm trying to change from v2.10.1 to v2.10.2. And can it be changed by path or maybe others?

To upgrade to 2.10.2, you can simply run
flutter version v2.10.2
and to downgrade:
flutter downgrade
flutter downgrade only works if you have installed previous version from the same channel. if not, you can run
flutter downgrade v2.10.1
UPDATE
seems like flutter version has been depreciated. You could use fvm to easily switch between different versions

Related

Not possible downgrade to Flutter 1.22.6

I am trying to downgrade my Flutter version to 1.22.6
I am using Flutter channel stable.
This is the output when I put in the terminal the command
flutter downgrade 1.22.6
There is no previously recorded version for channel "stable"
Yesterday was the last time I could downgrade to Flutter 1.22.6
Are there any changes in Flutter lastly?
Version 1.22.6 is listed in https://docs.flutter.dev/development/tools/sdk/releases?tab=macos
Should I download the SDK by hand?
It's no more possible to downgrade from flutter 2.xx to 1.xx. However you can use flutter Version Manager fvm its specifically made to control flutter versions plus along with that you can install flutter sidekick as well.Use multiple versions of flutter specific for your projects I am attaching link for you.
FVM Flutter Sidekick

How to run Flutter legacy library?

Flutter_Blue 0.8.0 Its library is not compatible with the version of Flutter I am using.
https://pub.dev/packages/flutter_blue/versions/0.7.3 How do I install this ? Pub dont work. Or why the Flutter_Blue package is not working for me. flutter_bluetooth_serial okey
If you want to use a lower version of the package, you can lower the SDK version.
Flutter 1.x version https://docs.flutter.dev/development/tools/sdk/releases

How to change the current Dart SDK version?

I ran the following commands in my foo project:
iDecode#iDecodes-Mac foo % pub get
Resolving dependencies...
The current Dart SDK version is 2.7.2.
Because foo requires SDK version >=2.12.0 <3.0.0, version solving failed.
iDecode#iDecodes-Mac foo % flutter --version
Flutter 2.6.0-11.0.pre • channel dev
Tools • Dart 2.15.0 (build 2.15.0-116.0.dev)
My pubspec.yaml file has:
environment:
sdk: '>=2.12.0 <3.0.0'
As you can see my current Dart SDK version is set to 2.7.2, my project is targeting a min of 2.12.0 and Dart SDK installed on my machine is 2.15.0. So, how do I change the current Dart SDK version?
This is my ~/.zshrc file
export PATH=/flutter/bin:$PATH
export PATH=$PATH:/$HOME/Library/Android/sdk/platform-tools/
export PATH="$PATH:/$HOME/flutter/bin"
export PATH="$PATH":"$HOME/.pub-cache/bin"
export JAVA_HOME=$(/usr/libexec/java_home)
It seems like you installed Flutter/Dart SDK somewhere using Homebrew. Use which flutter and which dart to see the actual Flutter/Dart command that is taking effect. Once you find where your Dart SDK is you can use
brew uninstall dart
After this when you run which dart it will now point to where your Flutter SDK was installed.
You can also try this way:
Just download that specific flutter version from here. and just set the flutter version in your editor and try to run it will run that specific flutter version but make sure you can't run that with terminal commands. So you need to handle all commands from the Tools option.
set flutter version
Must Run commands from here
The dart version is related with flutter version, see which version is what you need here
https://docs.flutter.dev/development/tools/sdk/releases
Upgrade by running flutter upgrade [check it out here] (update dart sdk for flutter)
Flutter comes with dart by default. Suggestion is to delete old flutter, delete .zshrc and download the latest stable version 2.5.3 for your mac and then give path for it in your .zshrc. Other method is switch to flutter stable by running flutter channel stable and then give flutter upgrade command so it will catch all the stuff from git in you local machine and you'll be good to go.
Simply go to the location where Dart SDK is kept and delete that and install a new Dart SDK version from the official website which is
https://dart.dev/get-dart
I had that same issue
Resolving dependencies... (5.3s)
The current Dart SDK version is 2.17.0.
Because talk_to_me depends on browser >=0.3.1+1 which requires SDK version
<2.0.0, version solving failed
I think we need to uninstall dart and install the correct version
To uninstall dart:
sudo apt purge dart

How to downgrade dart back to dart 1.x in Flutter?

I accidentally upgraded dart and flutter to the newest version but my code don't support null safety yet. Now I want to downgrade back to dart 1.x.
I tried flutter downgrade v1.2.1 but nothing changed. How can I downgrade back to dart 1.x?
You can downgrade flutter version by following below sequence.
type 'flutter downgrade 1.22.6'
Just type and command.
'flutter verion'
After 1,2 steps, you can see downgrading processing.
there is a tool that helps to manage different versions of flutter FVM
or you can use
flutter downgrade <version> (example: flutter downgrade v1.2.1)
If you want to downgrade flutter one the way which I use is to download the required SDK, unzip the folder and replace the existing flutter folder with the downloaded one.
Then restart the editor and you will the version you wanted.
Here are links for the Flutter SDK Release:
Windows
https://flutter.dev/docs/development/tools/sdk/releases
MacOS
https://flutter.dev/docs/development/tools/sdk/releases?tab=macos

How to downgrade your flutter SDK version?

My current Dart SDK Version is 2.1.2-dev.0.0.flutter-0a7dcf17eb.
However i need to use a flutter text recognition Dependency that requires SDK version >=1.23.0 <2.0.0
How can I downgrade my version?
In the Flutter install directory execute
git checkout v1.2.2
Now run
flutter doctor
You can just go from a version to another using the new commands
flutter downgrade -> go to the previous
flutter upgrade -> update to the new one
If you have a specific version of Flutter that you want to switch to (e.g. a previous stable version), you can use the flutter version command:
First find the version you wish to switch to here: https://flutter.dev/docs/development/tools/sdk/releases
Then, use flutter version command:
flutter version v1.9.1+hotfix.3
To pin Flutter package to a specific version, specify Flutter version explicitly in the pubspec.yaml file environment section:
environment:
sdk: '>=1.19.0 <3.0.0'
flutter: ^0.1.2
You have to run one command
flutter version
Above command shows you list of flutter version after that you can choose any version from that list. Using for example flutter version v1.9.1+hotfix.6