Windows Setup
- Environment Setup for Windows
- Install Git
- Install the Flutter SDK
- Install Android Studio
- (Optional) Android Phone Setup
- Android Emulator Setup
- Installing Visual Studio Code
- Testing your setup
Environment Setup for Windows
These instructions are for Windows 10/11 only. These instructions are distilled and customized from https://docs.flutter.dev/get-started/install.
Please do not hesitate to ask the instructor for help. There are a lot of steps, and they can be confusing. Reach out on Slack or by email.
Install Git
Lab computer: Git is already installed on UNCW lab machines.
Personal computer: Install the Git program if you do not already have it installed.
- Download the 64-bit standalone installer
- Leave all the default options checked, except:
- “Coosing the default editor used by Git”: select “Use the Nano editor…”
- “Adjusting the name of the inital branch in new repostories”: Select the “Override…” option.
Install the Flutter SDK
- Download the flutter_windows_3.16.5-stable.zip.
- Unzip the file in the current location, which will automatically create a
flutter/
directory. (Note: verify that you didn’t accidentally create subdirectory structure likeflutter/flutter/[MANY FILES]
) - Move this
flutter/
directory to your%HOME%
folder identified in Lab: Environment Setup, e.g.,c:\users\laymanl\
- Note: If your
%HOME%
folder has spaces in it, create a folder calledc:\dev
and use it as your%HOME%
folder.
- Note: If your
- Update your path:
- From the Start search bar, enter ‘env’ and select Edit environment variables for your account
- In the top ‘User variables’ section, do you have a variable named
Path
?- If Yes, select the
Path
variable and click Edit. Then click Browse, then navigate to and select%HOME%/flutter/bin
. - If No, click New click New and type
Path
as the variable name with exact capitalization. Then click the Browse Directory button and select the%HOME%/flutter/bin
folder.
- If Yes, select the
- Now, open a terminal or console window and type
flutter doctor
. You should see a bunch of Flutter output. If you see “Command not found” or something similar, contact the instructor for help.
Install Android Studio
If you work on Windows, you have to use Android even if you own an iPhone. You can only develop for iPhone if you have a Mac.
Personal computer
- Go to https://developer.android.com/studio and click the “Download Android Studio” button. Accept the license and download the file.
- Run the file and accept the default settings.
- The ‘Android Studio Setup Wizard’ will pop-up. Select “Standard Installation” and all default options. This will install a variety of tools needed to compile Android programs. You will need to accept some Android licenses. This installation will take a very long time.
Lab computer
- Go to https://developer.android.com/studio#android-studio-downloads.
- Scroll way down to select the file
android-studio-2023.1.1.17-windows.zip
(no .exe installer) next to Windows (64-bit). Accept the license and download the file. - Unzip the file into the current directory, which should create a folder named
android-studio
. - Move
android-studio
folder to your%HOME%
folder so that you have%HOME%\android-studio\
. - Browse to the file
%HOME%\android-studio\bin\studio64.exe
. Drag this file to your windows task bar, or right-click it and “Create a Desktop Shortcut”. - Run Android Studio (
studio64.exe
) - A Wizard will pop-up saying you need to install an SDK. Click through the installer with the default options.
(Optional) Android Phone Setup
If you have an Android phone you would like to use, follow https://docs.flutter.dev/get-started/install/windows/mobile?tab=physical#configure-your-target-android-device
Android Emulator Setup
You can set up an Android emulator, which is a simulated phone that runs in Android Studio that you can interact and test with. This is very handy, so you should at least try it.
Follow all of the instructions in the “Configure your target Android device” section of https://docs.flutter.dev/get-started/install/windows/mobile?tab=virtual#configure-your-target-android-device
Installing Visual Studio Code
We will use Visual Studio Code to write our Flutter apps. We could use Android Studio, but it requires a lot of RAM as do other essential tools like the emulator/simulator. So, we’ll use VS Code for the benefit of those with limited RAM.
Follow the instructions here: https://docs.flutter.dev/get-started/editor?tab=vscode.
Testing your setup
- Create a folder in your %HOME% directory called
flutter_projects
- Follow the instructions for Test Drive: https://docs.flutter.dev/get-started/test-drive?tab=vscode with the following modifications:
- When asked to Select a folder to create the project in, select the
flutter_projects
folder you created. - For a quick and dirty test, you can use a Web Browser as the target device.
- If you’re developing for iOS, you’ll need to launch an iOS simulator as in the instruction page.
- If you’re developing for Android, you should see the options to pick an Android Emulator device to run on.
- When asked to Select a folder to create the project in, select the
- Running/Debug will begin the process of compiling and running the Flutter project. This process will take a long time the first time you do it, but should be faster after that. You should see some output appear in the “Debug Console”. The Debug Console will likely show a lot of things being downloaded – this is okay, and also why it’s taking so long. Be patient.