packages的地址:
https://pub.dartlang.org/flutter/
无法访问是因为没翻墙
域名换成国内的镜像即可:
https://pub.flutter-io.cn/flutter/
复制charts: ^1.0.0+1
粘贴到pubspec.yaml
格式未对齐的情况下,无法加载
保存内容,关闭vs Code
删除lockfile ,打开vs Code ,运行
source ~/.bash_profile
flutter doctor
flutter pub get