问题:运行 flutter doctor 时出错或者长时间无响应

在命令行中,pub 支持 http_proxyhttps_proxy 环境变量。您可以按如下方式设置代理服务器环境变量。

On Linux/macOS:

1
export https_proxy=hostname:port

On Windows Command Prompt:

1
set https_proxy=hostname:port

On Windows PowerShell:

1
$Env:https_proxy="hostname:port"

If the proxy requires credentials, you can set them as follows.

On Linux/macOS:

1
export https_proxy=username:password@hostname:port

On Windows Command Prompt:

1
set https_proxy=username:password@hostname:port

On Windows PowerShell:

1
$Env:https_proxy="username:password@hostname:port"

Reference

Difficulty getting error when running flutter doctor
Pub get fails from behind a corporate firewall