Setup Flutter Environment

Eswar Abisheak
3 min readJul 9, 2020

--

Let’s Get mad!

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

Set up your Flutter environment(Windows install)

You need two pieces of software to complete this lab — the Flutter SDK and an editor+Android Studio.

Requirements

  1. Windows PowerShell 5.0
  2. Git for Windows
  3. Flutter SDK
  4. Android Studio

Let’s get installing

  1. install PowerShell 5.0 or newer version & Git (just go with the flow run and you know what to do)
  2. unzip the Flutter SDK in your preferred location like C:\Program Files\

Update your path

  1. search bar, enter ‘env’, and select Edit environment variables for your account.
  2. Under User, variables append the full path to flutter\bin
I unzipped the flutter SDK in the Downloads folder

3. Click ok and restart your computer

4. To check if it is done open CMD or PowerShell and type “flutter doctor” and hit enter.

you might get few errors because you aren't done with the installation

Install android studio

  1. Before installing Android SDK, you need to install Java Development Kit (JDK). Read “How to install JDK”. Ensure that your JDK is at or above 1.8. You can check your JDK version with command “javac -version".
  2. If you downloaded an .exe file (recommended), double-click to launch it.
  3. If you downloaded a .zip file, unpack the ZIP, copy the android-studio folder into your Program Files folder, and then open the android-studio > bin folder and launch studio64.exe (for 64-bit machines) or studio.exe (for 32-bit machines).
  4. In “Choose Components”, select “Android Studio” and “Android Virtual Device”.
  5. In “Configuration Settings Install Location”, accept the default “C:\Program Files\Android\Android Studio".
  6. In “Choose Start Menu Folder”, accept the default ⇒ Install.
  7. Launch Android Studio. Continue to the next Step
  8. Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.

https://developer.android.com/studio/videos/studio-install-windows.mp4

Set up your Android device

To prepare to run and test your Flutter app on an Android device, you need an Android device running Android 4.1 or higher.

  1. Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
  2. Windows-only: Install the Google USB Driver.
  3. Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
  4. In the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device. By default, Flutter uses the version of the Android SDK where your adb tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_SDK_ROOT environment variable to that installation directory.

Install the Flutter and Dart plugins(For android studio)

  1. Start Android Studio.
  2. Open plugin preferences (File > Settings > Plugins).
  3. Select Browse repositories, select the Flutter plugin and click Install.
  4. Click Yes when prompted to install the Dart plugin.
  5. Click Restart when prompted.

Install VS Code

VS Code is a lightweight editor with Flutter app execution and debug support.

Install the Flutter and Dart plugins

  1. Start VS Code.
  2. Invoke View > Command Palette….
  3. Type “install”, and select Extensions: Install Extensions.
  4. Type “flutter” in the extensions search field, select Flutter in the list and click Install. This also installs the required Dart plugin.

Validate your setup with the Flutter Doctor

  1. Invoke View > Command Palette….
  2. Type “doctor”, and select the Flutter: Run Flutter Doctor.
  3. Review the output in the OUTPUT pane for any issues. Make sure to select Flutter from the dropdown in the different Output Options.

Feel free to comment or ask queries in the comments section.

To learn more about flutter visit the official website flutter.dev.

--

--

Eswar Abisheak
Eswar Abisheak

Written by Eswar Abisheak

DSCVIIT lead || https://eswar.dev || HTB player || Competitive Coding

No responses yet