2

I am new to flutter and I came across this error ( Could not resolve URL "https://pub.dartlang.org". ) while creating new flutter project.

I Tried "flutter doctor -v" command but it is showing everything is fine, I tried if there is any more dependencies need to be installed from given website but I couldn't find a wayand I am connected to Internet(Proxy internet) as suggested in one of the answer in Stack Overflow.

snehit vaddi
  • 3,854
  • 2
  • 9
  • 13

2 Answers2

0

You can try specifying URL of the dependencies in the pubspec.yaml file. For example, instead of:

url_launcher: ^5.0.2 

try this:

  url_launcher: 
    hosted:
      name: url_launcher
      url: "https://pub.dev"
    version: ^5.0.2    

The official documentation shows various ways of using packages

Phong Nguyen
  • 41
  • 1
  • 5
0

Running this command fixed this issue for me,

flutter config --no-enable-web
Aadarsh Patel
  • 167
  • 4
  • 14