Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview

This is a setup for any Flutter project on a Windows 10/11 device, and is what we will be using to setup IMACS. You only have to go through the setup once. Anything that you need to download can be found inthe References section. Make sure Git is properly setup

Setting up Flutter

  1. Install Flutter if you do not have it installed. You can also refer to the link for further guidance

  2. When unzipping, Do not keep the version number as Flutter has an automatic update feature. When you extract the files, make sure you do so into a directory where there are NO spaces

  3. Add flutter to path [flutter unzip location]/flutter/bin

  4. Disable analytics by running the following in any terminal

    • flutter config --no-analytics

    • dart --disable-analytics.

  5. In VS Code:

    • Go to settings: Ctrl+, OR File→Preferences→Settings

    • Search for telemetry

    • Set to off

  6. Run flutter doctor. This command gives you a list of dependencies flutter requries before you can properly run your app. If you already have all the dependencies, you should see something like this in your terminal. If not, please follow the associated links the command gives you to set them up, or refer to the documentation below.

...

Android Studio and Android Toolchain setup

One of the flutter dependencies you may not have on your machine is Android Studio or the Android Studio Toolchain. If the steps presented with flutter doctor do not work for you, please follow the steps below

...

  1. Once they are installed, add the following variables to your path to ensure they are accessible. 

    • [Android SDK installation directory]/platform-tools

    • [Android SDK installation directory]/emulator

    • [Android SDK installation directory]/tools

    • [Android SDK installation directory]/tools/bin

  2. Download the Java Development Kit if you do not have it already. Make sure you know the directory it is installed in

  3. Create some environment variables:

    • Create a JAVA_HOME variable and set the directory to your jdk installation

    • Create a ANDROID_HOME variable and set the directory to your android sdk installation

  4. Run flutter doctor. If this is no longer showing you a warning/error for Android Studio and Android Toolchain, run flutter doctor --android-licenses and accept all licenses. If you are still running into issues, watch this video here

Visual Studio Setup

Another dependency that you may not have already is Visual Studio (Dififerent Different from Visual Studio Code). Follow these short steps to get it setup for Flutter.

  1. Download Visual Studio. Navigate to where you downloaded it and open the exe

  2. Once it prompts you to select add-on’s to download, include “Desktop development with C++” and all its default components 

  3. Run flutter doctor in your Command Prompt  to confirm that you have it installed. If you find issues, watch this video here

...

VSCode Setup

Progress to this step ONLY IF you run flutter doctor and have no issues. If you run into issues, refer to the setup guide provided by flutter linked in the reference section:

  1. Start VSCode 

  2. Open a browser and go to the Visual Studio Marketplace. Here, search for the Flutter extension.

  3. Click Install. Installing the Flutter extension also installs the Dart extension.

Validating your Setup with a Sample Project

If you want to make sure your setup works with an existing sample project you can find the complete instructions here or follow the steps below.

Setting up the test application

  1. Open up VS Code

  2. Invoke View > Command Palette.

  3. Type “flutter”, and select the Flutter: New Project.

  4. Select Application.

  5. Create or select the parent directory for the new project folder.

  6. Enter a project name, such as my_app, and press Enter.

  7. Wait for project creation to complete and the main.dart file to appear.

Running the test application

  1. Locate the VS Code status bar (the blue bar at the bottom of the window):

  2. Select a device from the Device Selector area (below

...

If you see this screen, that means your setup is working! If you run into some errors, please make sure flutter doctor does not return any issues, and you have everything correctly setup as per the instructions above. If you still run into issues, ask google!

Setting up the IMACS 2.0 Repository

  1. Visit the UWARG github and locate the IMACS 2.0 repo: https://github.com/UWARG/IMACS-2

  2. Clone the IMACS 2.0 repository to local:

...

  1. Hit ‘run and debug’ on the main.dart file to ensure the file is working.

References