'How to fix the proxy setup issue with flutter?

I am new to flutter. We have a proxy setup in the network. The proxy is already applied to android studio and it is working fine. While creating a new application it is working fine. But, get packages is not working. It returns

Could not resolve URL "https://pub.dartlang.org".

pub get failed (69) -- attempting retry 1 in 1 second...'

set https_proxy=USERNAME:PASSWORD@hostname:port' I tried this code. Even though it is not working

Get packages is not working



Solution 1:[1]

You need to run these 2 lines on both your Flutter folder and your project folder:

set https_proxy=USERNAME:PASSWORD@hostname:port
set http_proxy=USERNAME:PASSWORD@hostname:port

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Benjamin Corben