Install Flutter in Windows 11 behind proxy

Test previous story at home without proxy to at work with one

Sparisoma Viridi
9 min readJan 22, 2024

When I search on Medium with Google about Flutter and proxy I have found only solving proxy problem during development, where you must set it for Visual Studio Code, Android Studio, Android Emulator, Flutter, Git, and other software you use (Syarif, 2022). We can use proxy to inspect underlaying web traffic of an application, which alter the flow of traffic from flutter application — the client to an intercepting proxy and then forward it to the server as the client communicates directly with the server (Hayes, 2019). Flutter support only limited proxy configuration, e.g. using environment variables, and if you will not define them the http request will bypass system proxy configuration (Yamshchikov, 2021). In previous story how to install Flutter in Windows 11 step-by-step has been presented (Viridi, 2024a). Here in this story those steps are repeated but for computer at work, which is behind institution or company proxy. Problems faced during installation are accompanied with the solutions.

System

  • OS: Microsoft Windows 11–10.0.22621 (64-bit)
  • Processor: Intel(R) Core(TM) i5–10210U CPU @1.60GHZ 2.10 GHz.
  • Core: 4core(s), 8 logical processor(s).
  • RAM: 8.00 GB (7.81 GB usable).
  • Display: 1920 × 1080.
  • Drive: 349 GB free.

Above information is for documentation only and they are different compared to system in previous story.

Download installer

Steps in this part are in general the same as in in previous story. Let us download the installer from https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.16.8-stable.zip.

Wait for the download process to finish. Go to your download folder, e.g. Downloads and copy the file flutter_windows_3.16.8-stable.zip to the folder, where you keep all installers, e.g. R:\Installer as follow.

Press Windows key ⊞, type powershell, and press Enter key.

Type $PSVersionTable and git --version to view version of PowerShell and Git. Type cd ..\.. to go to C:\.

Create C:\dev folder and change current directory to it.

Expand zip

To expand flutter_windows_3.16.8-stable.zip file type on the console

Expand-Archive -Path R:\Installer\flutter_windows_3.16.8-stable.zip -DestinationPath .

and press Enter key. There is color issue on the terminal as discussed here.

Wait for the process to populate C:\dev\flutter with files and folders from Flutter. Type dir flutter to see the content of flutter folder.

It shows that Flutter files and folders have been extracted from flutter_windows_3.16.8-stable.zip file.

Update Windows PATH

Check first current value of PATH. Type $env:path -split ";".

There is not any entry for Flutter C:\dev\flutter\bin on Windows PATH. Solve this with following steps.

  • Press ⊞, type environment, press enter to System Properties window.
  • Click Environment Variables… button on the second row from the bottom to open Environment Variables window.
  • Click for Path under User variables for your-user-name and click Edit button to open Edit environment variable window.
  • Click New button, type C:\dev\flutter\bin, click several times Move Up button until the last entry sits on the top of the list, click OK to close the current window.
  • Click OK to close Environment Variables window.
  • Click OK to close System Properties window.

Close PowerShell console, open it again, and type $env:path -split ";" to see updated Windows PATH.

Now the path to Flutter C:\dev\flutter\bin is listed on Windows PATH.

Type flutter --version will show version of Flutter, Dart, and DevTools.

Configure toolchain

You should have first install Android Studio to follow this part. If not, follow steps provided (Viridi, 2024b). Then press Windows key ⊞, type android studio and press Enter key.

Choose Do not import settings and click OK button.

Choose which one you think the best.

Click Next button.

Click Finish button.

Click Finish button.

It seems that Virtual Device Manager is missing.

Click SDK manager.

Type proxy and start to fill proxy information of your organization.

Click Check connection button.

Type any URL to check connection to and click OK button.

It shows that proxy settings are correct. Click OK button and again click OK button. Close the application.

Open it again.

It asks you login and password for organization proxy. Fill and and click OK button.

It shows missing SDK. Click Next button.

Just accept the suggestion and click Next button.

Click Next button.

Click Accept.

Click Finish button.

You can click Show Details.

Wait for the components download.

Click Finish button. And close the application using × on top right corner of the open window.

Set up emulator

Start Android Studio.

Click More Actions and then choose Virtual Device Manager.

Click Allow.

Click + to open Select Hardware window.

Click New Hardware Profile on the lower left.

Fill available information and click Finish button.

Now you have your device, e.g. Samsung A12 in my case. Click Next button.

Choose UpsideDownCake and click Download icon.

Choose Accept and click Next.

Wait for the process.

Click Finish button.

Now you can proceed since a system image is set. Click Next button.

You Android Virtual Device is ready. Click Finish.

An AVD is available, the Samsung A12 API 34. Click ▷ to emulate the device.

Click Allow to allow the emulation of you device.

Now you have emulator of your device, the Samsung A12 with API 34.

Click stop button □ to stop the running AVD. Close All window using × on top right corner of each windows.

Agree to Android licenses

You must agree to the licenses of the Android SDK platforms after installing all prerequisites and before using Flutter. Open elevated PowerShell console or Run as Administrator, and type flutter doctor --android-licenses, and press Enter.

PS C:\WINDOWS\system32> flutter doctor --android-licenses
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools
are installed to resolve this.

Open Android Studio and click More Actions → SDK Manager.

On the left menu browser Languages & Frameworks → Android SDK.

Choose second tab menu SDK Tools.

Check the not installed Android SDK Command-line Tools (lates) and click OK button.

Click OK button.

Wait for the process.

Click Finish button. Close Android Studio. Set proxy on the recently open PowerShell console by typing

$proxy='https://username:password@ip:port

followed by

$ENV:HTTP_PROXY=$proxy
$ENV:HTTPS_PROXY=$proxy

then repeat type flutter doctor --android-licenses and press Enter.

Type y and press Enter.

Type again y and press Enter.

Repeat it again.

And again.

And again.

And this is the last one.

All SDK package license are accepted. Close the elevated console.

Check development setup

Open PowerShell console.

To fix the first error, in this case I do not want to develop Windows apps. Use flutter config --no-enable-windows-desktop and press Enter.

Now the requirement of Visual Studio — develop Windows apps is excluded. To overcome the occurring cryptographic error set the proxy.

Type $ENV:NO_PROXY='127.0.0.1;localhost;::1' then press Enter.

Now you have Flutter Doctor report that there is no issues found.

Summaries

After reading this story you are able to

  • install Flutter,
  • set the proxy of Androdi Studio and configure toolchain,
  • agree to Android licenses and install missing SDK behind proxy,
  • check development setup behind proxy.

Thanks to Gordon Hayes, Ahmad Syarif, and Sergey Yamshchikov for the inspirational stories.

--

--