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
Install Flutter if you do not have it installed. You can also refer to the link for further guidance
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
Add flutter to path [flutter unzip location]/flutter/bin
Disable analytics by running the following in any terminal
flutter config --no-analytics
dart --disable-analytics.
In VS Code:
Go to settings: Ctrl+, OR File→Preferences→Settings
Search for telemetry
Set to off
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
...
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
Download the Java Development Kit if you do not have it already. Make sure you know the directory it is installed in
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
Run
flutter doctor
. If this is no longer showing you a warning/error for Android Studio and Android Toolchain, runflutter 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.
Download Visual Studio. Navigate to where you downloaded it and open the exe
Once it prompts you to select add-on’s to download, include “Desktop development with C++” and all its default components
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:
Start VSCode
Open a browser and go to the Visual Studio Marketplace. Here, search for the Flutter extension.
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
Open up VS Code
Invoke View > Command Palette.
Type “flutter”, and select the Flutter: New Project.
Select Application.
Create or select the parent directory for the new project folder.
Enter a project name, such as
my_app
, and press Enter.Wait for project creation to complete and the
main.dart
file to appear.
Running the test application
Locate the VS Code status bar (the blue bar at the bottom of the window):
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
Visit the UWARG github and locate the IMACS 2.0 repo: https://github.com/UWARG/IMACS-2
Clone the IMACS 2.0 repository to local:
...
Hit ‘run and debug’ on the main.dart file to ensure the file is working.
Setup Mission Planner (see references)
References
Flutter
Java Developement Kit - https://www.oracle.com/ca-en/java/technologies/downloads/#jdk21-windows
Visual Studio - https://visualstudio.microsoft.com/downloads/
Android Studio - https://developer.android.com/studio
Mission Planner - Ardupilot Simulation with Mission Planner