[Dart语法] dart pub get
Resolving dependencies...
pubspec.yaml has no lower-bound SDK constraint.
You should edit pubspec.yaml to contain an SDK constraint:
environment:
sdk: '^2.12.0'
在 pubspec.yaml 文件中添加
environment:
sdk: '^2.12.0'
![](https://i-blog.csdnimg.cn/blog_migrate/d6ff477fd65d53d0bd40620ee175cfda.png)
然后再重新:
dart pub get
如果接着出现下面报错:
Got TLS error trying to find package http at https://pub.dev.
那么修改镜像:
我这里使用的是腾讯镜像:
配置环境变量的方式(win10)
![](https://i-blog.csdnimg.cn/blog_migrate/e501df56c11ee2bc7023acd70c06ea91.png)
分别新建两个变量:
变量名:
PUB_HOSTED_URL
值:
https://mirrors.cloud.tencent.com/dart-pub
变量名:
FLUTTER_STORAGE_BASE_URL
值:
https://mirrors.cloud.tencent.com/flutter