When trying to import http package I can see the red underlining as it is error.
In terminal I tried running "flutter clean" and then adding "http: ^0.12.0" to pubspeck.yaml and running "flutter packages get" but it shows: "Could not resolve URL "https://pub.dartlang.org". pub get failed (69)"
Packages like "flutter/material.dart" are correctly imported. Don't know what to do.
Could this be issue with http not being back-compatible with flutter 1.0?
So the problem was I was behind proxy and added enviromental variables (https_proxy) as strings in quotation marks, where they should be added without " ". More here (https://www.dartlang.org/tools/pub/troubleshoot).
On Linux/macOS:
$ export https_proxy=hostname:port
On Windows Command Prompt:
$ set https_proxy=hostname:port
On Windows PowerShell:
$ $Env:https_proxy="hostname:port"
If the proxy requires credentials, you can set them as follows.
On Linux/macOS:
$ export https_proxy=username:password@hostname:port
On Windows Command Prompt:
$ set https_proxy=username:password@hostname:port
On Windows PowerShell:
$ $Env:https_proxy="username:password@hostname:port"
For more information refer this link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With