Development environment: AndroidStudio, Flutter_1.17.3

I installed Android Studio and created a new Flutter project.
At this point, the demo code originally included was able to run successfully.

Since I wanted to create a graph this time, I added charts_flutter to the dependencies of pubspec.yaml and executed flutter pub get
The following message was displayed and I could not complete normally.

C:~\flutter_windows_1.17.3-stable\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in flutter_app...
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable)-attempting retry 1 in 1 second...
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable)-attempting retry 2 in 2 seconds...

So, I deleted the description about charts_flutter added to pubspec.yaml, returned it to the state when the project was newly created, and ran flutter pub get again, but for some reason the same message as above came out, and a new project was created. I am also unable to execute the hourly sample demo code.

All the above operations are performed on Android Studio.

It is possible to access https://pub.dartlang.org with a browser, and the proxy of Android Studio, gradle, github is already set.

Please let me know if there is any remedy.

  • Answer # 1

    I couldn't solve it, so I managed to manually download the package from the browser and store it locally.

  • Answer # 2

    I just searched for "Could not resolve URL "https://pub.dartlang.org"."


  • Answer # 3

    At the command prompt,

    flutter packages get

    Is it no good?