Flutter package targeting min version - flutter

I published a package to pub.dev that uses the Flutter SDK version 1.6.3 which as of today is the beta channel
However the pub analyser uses v1.5.4-hotfix.2 which does not have those API changes just yet, presummably because it is using on the stable channel
When I specified the min version in the pubspec.yml file for flutter it outright failed
STDERR:
ERR : The current Flutter SDK version is 1.5.4-hotfix.2.
|
| Because ...... requires Flutter SDK version ^1.6.3, version solving
failed.
pub finished with exit code 1
Is there a way to get the pub website to accept the beta channel builds and not have the package fail?

I've found this thread https://github.com/dart-lang/pub-dev/issues/2283 and seems you have to use the stable channel version to publish a package

try to change sdk
or
try to upgrade Flutter Package
tools>>flutter>>flutter Upgrade

Related

how do I point latest Dart version to this project?

I am trying to run the code on below project but has been noticing the error about Dart SK version (See below error).
Tried: pub get on YML file, get dependencies on main.dart file but same error. Any help? I read earlier resolution which says adding the version at YML file but it did not work. I also, installed the 2.17.6 in my machine and configured the Environment variable but no luck. Help please
Project from Github:
git clone https://github.com/flutter/codelabs.git
cd codelabs/boring_to_beautiful/step_01/
Error on Android Studio:
Waiting for another flutter command to release the startup lock...
Running "flutter pub get" in step_01...
The current Dart SDK version is 2.17.1.
Because myartist requires SDK version >=2.17.6 <3.3.0, version solving failed.
pub get failed (1; Because myartist requires SDK version >=2.17.6 <3.3.0, version solving failed.)
Process finished with exit code 1
The pubspec.yml has below
environment:
sdk: ">=2.17.6 <3.3.0"

How to downgrade flutter version

I updated my flutter version by flutter upgrade --force command and now my project doesn't compile
is there is a way to downgrade to old version (i dont know my old version number)
please help me because this is my graduation project
If you're seeing the message:
There is no previously recorded version for channel "stable".
Navigate to your Flutter installation folder and run git checkout flutter_version
If you're using snap on Linux and want to downgrade to 1.22.6:
cd $HOME/$USER/snap/flutter/common/flutter
git checkout 1.22.6
flutter --version
For change the Flutter sdk version use this command:
For upgrade the latest version:
flutter upgrade 1.20.0 //version number
For decrease the Flutter sdk version:
flutter downgrade 1.18.0 // version number
And for check the version which you Currently used:
flutter --version
You need go to flutter sdk folder and run git command checkout your version
get flutter sdk path on android studio:
File -> Settings -> Languages & Frameworks -> Flutter -> FLutter SDK path
Change flutter channel if you want
flutter channel <branch> (example: flutter channel dev or flutter channel stable)
Change Flutter version:
git checkout <version> (example: git checkout 2.0.3)
after: flutter doctor -v
hope to help some body
flutter downgrade versionnumber
Eg : flutter downgrade 1.25.0
Changing the Flutter version is like changing git branch.
if you want to change the channel use
flutter channel <branch> (example: flutter channel dev or flutter channel stable)
There are four flutter Channels
1). stable 2). dev 3). beta 4). master
You can further study about these channels from here
flutter downgrade <version>
You can see versions from here
After completion, run flutter doctor, and Flutter will take care of downloading/compiling everything required to run this version.
flutter version is now deprecated. flutter downgrade <version-no> will do the trick ! After this run flutter doctor. It will take care of the rest.
This is the best method to switch flutter versions
First:
Check the Flutter versions that you want and in what Channel
from here https://docs.flutter.dev/development/tools/sdk/releases?tab=macos
Second:
on your terminal just type
1- switch to the channel that contains your version
flutter channel stable
2- downgrade using this
flutter downgrade v2.10.5
This is working for me every time
Simple question,
1- you have to access the directory where your flutter is installed by terminal. ex: cd C:\src\flutter
2 - then, you write the command git checkout (number of version).
3 - flutter --version.
It's similar with the guy above, but the difference is that i was trying to
install downloading the file on the link for sdk installations, but it didn't work.
So, i followed these steps and it works for me.
What worked for me was downloading the version directly from Flutter SDK's website and replacing the old flutter folder from /Users/NAME/flutter/ with it.

Flutter Dart on windows 10

When I am running any command that uses dart the response is always as follows;
building flutter tool...
Running Pub upgrade...
The current Dart SDK version is 2.10.0-0.0.dev.flutter-9dca49e71e.
Because flutter_tools depends on collection >=1.15.0-nnbd <1.15.0-nullsafety.2 which requires SDK version >=2.9.0-18.0 <=2.9.10, version solving failed.
I am not able to switch the version nor the channel as those commands run through the same response.
I tried to uninstall flutter and dart, but I have only gotten back to the same issues.
Any help?
Navigate to where to your flutter install directory e.g. C:\Tools\Flutter and do a git pull.
After that you should be able to run any command, such as flutter --help and the Dart SDK will be on the correct version.
This can be verified by running flutter upgrade
I just needed to update my Path ENV Variable

Dart 2.6 and Flutter, Upgrading Dependency

Using Flutter, I am trying to update my dart dependency 2.6.0 but I get an error
Because *project_name* requires SDK version >=2.6.0 <3.0.0, version solving failed.
pub get failed (1)
exit code 1
I want to use the new features that dart offers, such as Extension Methods. How could I go about upgrading my dependency? I have installed the newest stable version of dart on my computer, but regardless I still get that error.
A couple of things that might help:
From this issue, you can try ensuring that you've updated enviroment in your pubspec.yaml file like so:
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
Another thing that might help is just double checking the steps in this post or on the dart installation page to ensure that you've updated to the latest version correctly.

Because every version of flutter_goldens from sdk depends on pedantic 1.7.0 and flutter_gallery depends on pedantic 1.8.0+1

I download flutter gallery app from github , when tried to build it and get the dependencies with flutter get dependencies it show me the below error
Because every version of flutter_goldens from sdk depends on pedantic 1.7.0 and flutter_gallery depends on pedantic 1.8.0+1, flutter_goldens from sdk is forbidden.
So, because flutter_gallery depends on flutter_goldens any from sdk, version solving failed.
I solved the problem by switching from beta to master channel :
to see the actual channel run
flutter channel
and to switch to master cannel run :
flutter channel master