Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Getting Started Flutter

Explaining how to setup flutter for Windows and Mac users using VS Code or Android Studio

Some links for more in-depth learning

Setting started/setup

Purely text-based resources

Setting up VS Code purely

Windows

  • Java Development Kit - Install JDK here. Take note of the installation directory as we would have to add to path. Adding JDK to path
  • Download flutter SDK latest version from the following Url: https://flutter.io/docs/get-started/install/windows extract it and copy the folder with the name “flutter” to C:\ folder, so the full path will be C:\flutter
  • Download the Android command line tools - Android Command Line Tools, extract after downloading. Create the folder "Android" in C:\Users\USER\AppData\Local and the folder Sdk in C:\Users\USER\AppData\Local\Android and copy the tools folder here.
  • Set the environment variables - we need to define some environment variable which let the above tools know how to contact each other, form command prompt run these commands, one by one.
    • setx ANDROID_HOME "C:\Users\USER\AppData\Local\Android"
    • ANDROID_SDK_ROOT "C:\Users\USER\AppData\Local\Android\Sdk"
    • path "%path%;"C:\Users\USER\AppData\Local\Android\Sdk;C:\Users\USER\AppData\Local\Android\Sdk\bin;C:\flutter\bin"
  • Download Android Sdk - As you may already know Flutter needs Android SDK to work , so we need to download system images, platform tools, build tools, platforms, and emulator, by running the following commands:
    • sdkmanager "system-images;android-29;google_apis;x86_64"
    • sdkmanager "platforms;android-29"
    • sdkamanger "platform-tools"
    • sdkmanager "patcher;v4"
    • sdkmanager "emulator"
    • sdkmanager "build-tools;29.0.2"
  • Accept all licenses (press y then enter for every license)
    • sdkmanager --licenses
  • Configure flutter to know the directory of the android sdk
    • flutter config --android-sdk C:\Users\USER\AppData\Local\Android\
  • Create the emulator (use any of the below to create the emulator)
    • create an emulator with the name pixel: avdmanager -s create avd -n pixel -k "system-images;android-29;google_apis;x86_64"
    • create an emulator with the name nexus: avdmanager -s create avd -n nexus -k "system-images;android-29;default;x86_64"
    • create an emulator using existing devices features: avdmanager -s create avd -n pixel -k "system-images;android-29;google_apis;x86_64" -d 19
    • to get list of existing devices: avdmanager list
  • Launch emulator
    • flutter emulator --launch emulator_name
  • Now to the moment of truth
    • Run flutter doctor. This command should give all green and ok. Please ignore the Android Studio complain as this lesson is all about ignoring it.

Mac

  • Watch this space