Dart version changes - flutter

Im getting the following error while getting the google_maps dependency on a flutter app
Because app requires SDK version >=2.14.0 <3.0.0, version solving failed.
pub get failed (1; Because app requires SDK version >=2.14.0 <3.0.0, version solving failed.)
Im currently in version The current Dart SDK version is 2.14.0-188.5.beta.
does this mean my dart version is not updated?
I solved the problem by downgrading google_maps_flutter but is this the correct way of doing things?

Change sdk version in pubspec.yaml to
environment:
sdk: ">=2.14.0 <3.0.0"

Related

Because package_name requires SDK version >=2.17.6 <3.0.0, version solving failed

In my project I am using flutter package new_version_plus but when I use pub get it gives an error as follows:
Because package_name requires SDK version >=2.17.6 <3.0.0, version solving failed.
pub get failed (1; Because package_name requires SDK version >=2.17.6 <3.0.0, version solving failed.)
exit code 1
I made the changes as per required SDK version but still I got the same error.
You need to upgrade flutter using flutter upgrade command and then flutter will use latest version of Dart SDK.
Update 'SDK version >=2.17.6 <3.0.0' like this in pubspec.yaml file.
pls check new version package official doc example : https://github.com/CodesFirst/new_version_plus/blob/master/example/pubspec.yaml
You should not update the dart version of this project, open pubspec.yaml file and update
environment: sdk: ">=2.12.0 <3.0.0" or Whatever your sdk version
to
environment: sdk: ">=2.16.0 <3.0.0"

flutter android studio

The current Dart SDK version is 2.15.1.
Because flutter_projects requires SDK version >=2.17.6 <3.0.0, version solving failed.
but the dart version is 2.19.0
I'm guessing that you can just update pubspec.yaml file. Write this instead.
environment:
sdk: ">=2.15.1 <3.0.0"
Or upgrade your flutter version by running:
flutter upgrade

Can't pub-get from pubspec.yaml file in Flutter app

Every time I want to install a package it gives this error, how do I fix it? The error output is below:
The current Dart SDK version is 2.12.3.
The current Flutter SDK version is 0.0.0-unknown.
Because image_picker >=0.3.0 requires Flutter SDK version >=0.1.4 and image_picker <0.3.0 requires SDK version >=1.8.0 <2.0.0, image_picker is forbidden.
So, because firebase depends on image_picker any, version solving failed.
Running "flutter pub get" in firebase...
pub get failed (1; So, because firebase depends on image_picker any, version solving failed.)
You check your flutter version and check that dependency version and change the dependency version otherwise remove the version.
You have to either:
Downgrade the version of image_picker to match the flutter SDK version you currently use, or
Upgrade your flutter SDK version to a version above or equal to 1.8.0. (preferred solution).

Flutter create has a prblem doing the get cos it thinks my dart version is too low

I am creating a flutter project with flutter create. as part of that i guess it runs flutter pub get. but that fails cos:
[chat_app] flutter pub get
Running "flutter pub get" in chat_app...
The current Dart SDK version is 2.14.2.
Because chat_app requires SDK version >=2.15.1 <3.0.0, version solving failed.
pub get failed (1; Because chat_app requires SDK version >=2.15.1 <3.0.0, version solving failed.)
exit code 1
when i run dart --version it says
Dart SDK version: 2.15.1 (stable) (Tue Dec 14 13:32:21 2021 +0100) on "windows_x64"
Im not sure whats happening
you should upgrade your project sdk to 2.15.1.
go to you project folder, open pubspec.yaml file and change sdk to 2.15.1
environment:
sdk: ">=2.15.1 <3.0.0"

Because project requires SDK version >=2.14.0 <3.0.0, version solving failed even though Dart SDK version is 2.14.0-350.0.dev

I want to make use of typedefs for variables in Dart thus I am trying to update minimum dart version to 2.14.0.
When I change environment to
environment:
sdk: ">=2.14.0 <3.0.0"
I get the following error
[project] flutter pub get
Running "flutter pub get" in project...
The current Dart SDK version is 2.14.0-377.0.dev.
Because project requires SDK version >=2.14.0 <3.0.0, version solving failed.
pub get failed (1; Because project requires SDK version >=2.14.0 <3.0.0, version solving failed.)
exit code 1
Now I am confused what >= means if my version is 2.14.something and it does not satisfy condition >=2.14.0.
Any idea what's going on?
flutter doctor
[√] Flutter (Channel dev, 2.5.0-5.0.pre, on Microsoft Windows [Version 10.0.19043.1110], locale en-GB)
...
The version of the Dart SDK you have installed is 2.14.0-377.0.dev; the -377.0.dev part indicates that it is a development release (a pre-release), which cannot satisfy a requirement for a stable version of 2.14.0 as required by your pubspec.yaml constraints.
(Imagine that a development release introduced some new feature before some major bug was noticed and fixed. If your package depends on that feature, you probably would not want an unstable development release to satisfy your package's dependency requirement by default.)
You can set sdk: ">=2.14.0-0 <3.0.0" instead (note the -0) to indicate that you accept development versions of 2.14.0.