Dart pub reads proxy environment variables. For one dependency-resolution operation in a POSIX shell, supply them on the invocation:

http_proxy=http://proxy.example:8080 https_proxy=http://proxy.example:8080 dart pub get

The HTTP proxy can serve both destination schemes. For permitted public package downloads without proxy authentication, choose candidate endpoints from the HTTP proxy list for those values. Its URL describes the intermediary; package hosts remain the destinations selected by the dependency resolver.

Dart's troubleshooting documentation describes http_proxy for HTTP and https_proxy for HTTPS, with supported authentication credentials in the proxy URI when required. Encode reserved characters in those credential components before constructing such a URI.

An IDE's package action runs inside the environment available to that IDE or its Dart process. A value exported in a separate terminal does not update a process already running elsewhere. Set the launch environment used by the actual operation when terminal and IDE behavior differ.

A 407 identifies the proxy's authentication challenge. A package-server refusal concerns another participant. Keep the failing URL and response with the report so repository access and intermediary access can be handled at the right place.

Allakkat attuumassuteqartut