dart SDK version doesn't seem to change - dart

I had Dart SDK with version 2.16 installed and worked fine on my machine.
I tried to install the Dart with version 3 which is currently in development (3.0.0-0.0.dev), so in order to try it, I replaced the path of the Dart sdk in the environment variables with the path of the new dart with version 3, Then I created a new project on VScode, and this showed up:
Here I am writing code with the Records feature ( Which exists only in that Dart 3 dev version), and this error shows up:
This requires the 'records' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 3.0.0 or higher, and running 'pub get'.
But on my pubspec.yaml:
environment:
sdk: '>=3.0.0-0.0.dev <3.0.0'
but that error is thrown, and I have no idea what cause it and how I can fix it and run the code successfully.
Thank you.

Related

cmake.js and node_module_version

After building my electron node addon using cmake-js I got the following error
This version of Node.js requires
NODE_MODULE_VERSION 103. Please try re-compiling or re-installing
What's the proper way to specify the node module version in cmake.js file or in the cmake-js compile command?

How to use old version of Flutter and Dart

I'm a new developer and I'm trying to work with an existing IOS application built with Flutter. Some of the pubspec.yaml files show:
version 1.0.2+1
environment sdk ">=2.3.0 <3.0.0
And then various dependencies of other apps.
If I use the latest version of flutter, the application doesn't build. It needs to be built with flutter v1.0.0. But when I install that specific version, flutter pub get doesn't get the rest of the dependencies.
I'm guessing that I'm doing something wrong, but I don't know what.
Please help!
Thank you,
Thomas

Flutter giving errror in old sdk files although I have upgraded the sdk

I created project using flutter sdk version 1.7.8. After long time when I run the build it was giving me errors in sdk files. So I just downloaded new version of flutter sdk (2.2). I have changed environment path to latest sdk version, but when I run project it still giving me error related to older sdk version.
Here is the error
/C:/flutter_windows_v1.7.8+hotfix.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_slidable-0.4.9/lib/src/widgets/slidable.dart:786:46: Error: Method not found: 'TypeMatcher'.
return context.ancestorStateOfType(const TypeMatcher());
This is my environment variable
Why it is giving error related to version 1.78, although I have provided version 2.2 in my environment variable.
I think the one of the plugins that you are using is deprecated when you upgrade flutter you mostly need to upgrade the plugins as well.
and you need to change your pubspec.yaml file also and change the dart version .
so run flutter clean first.
change dart version. then try to run if it doesnt work still you need to upgrade plugins and remove the deprecated plugin.
OR
You might have the old Path in your IDE (Android Studio, VS CODE ) ETC.

How do I force the code not to required to run on earlier Dart version (earlier than Dart 2.2)?

I got Dart version 2.9.0. And my flutter is running with that version now.
However, I got this message:
Set literals weren't supported until version 2.2, but this code is required to be able to run on earlier versions
But I don't want it to be required to run on Dart versions earlier than 2.2.
How do I force it to run only on versions after 2.2 ?
You can edit the dart sdk constraints in your pubspec.yaml file to only use dart versions 2.2 and later.
environment:
sdk: '>=2.2.0 <3.0.0'
See this site for more information about the pubspec.yaml file.

How can I test the latest Polymer lib when it requires an older SDK?

I wanted to give the latest Dart Polymer lib a spin, so I updated the pubspec file and ran a pub install. However, the install fails with the following message:
Pub install failed, [1] Resolving dependencies.........
Package polymer requires SDK version >=0.8.1+1 but the current SDK is
0.7.6+4.r28108
Is it somehow possible to use the latest Polymer version via pubspec, or do I need to build the SDK myself from the sources?
https://www.dartlang.org/tools/editor/ has links to the bleeding edge, continuous build DartEditor
https://storage.googleapis.com/dart-editor-archive-continuous/latest/darteditor-win32-32.zip
https://storage.googleapis.com/dart-editor-archive-continuous/latest/darteditor-win32-64.zip
As of today, you should be able to upgrade 0.8.1.2 if you go to Help > About Dart Editor.
It seems pretty common that the libraries update a day or two before the SDK, so normally when I run into this problem I put in the pubspec something like the following until I can update the SDK:
dependencies:
polymer: "< 8.0.0"

Resources