Photo by Fahim Muntashir on Unsplash
Setting up Flutter as a Beginner
A Beginner-Friendly Guide for Windows, macOS, Linux, and Chrome OS
Getting Started with Flutter
Flutter is an exciting framework that allows you to build beautiful cross-platform mobile applications. If you're new to Flutter, don't worry – setting it up is easier than you think! In this guide, we'll walk you through the installation process on Windows, macOS, Linux, and even Chrome OS. We'll cover both Android Studio, Visual Studio Code and even IntelliJ IDEA to make sure you have the tools you need to start coding.
Installing Android SDK
Installing Android Studio and its SDK is a crucial step for Flutter development. Below, I'll provide a beginner-friendly guide for installing Android Studio on Windows, macOS, and Linux.
Download Android Studio:
Download the installer for your operating system.
Install Android Studio
- When it comes to installing depending on the OS you are in instructions may differ as below.
For Windows, run the .exe installer.
For macOS, open the downloaded .dmg file and drag Android Studio to the "Applications" folder.
For Linux, extract and run the installer in the
bin
directory using./studio.sh
.For chromeOS, just follow the Linux instructions after enabling Linux support on your Chromebook.
Follow the wizard instructions for installing once the installer is running.
Install Android Virtual Device (AVD) during setup.
Launch Android Studio
Configure Flutter in Android Studio by installing the Flutter and Dart plugins before restarting the IDE.
Access the SDK Manager, click on "Configure" at the bottom right corner and select "SDK Manager."
Install Command-Line Tools:
In the SDK Platforms tab, select "Show Package Details."
Look for "Android SDK Command-line Tools" and check the box.
Click "Apply" to install.
Installing Flutter SDK
To install the Flutter SDK, follow these general instructions. I'll specify any OS-specific steps where needed:
Downloading and Extracting
Download the Flutter SDK from the official website.
Extract the ZIP file to a preffred location on your machine.
Adding Flutter to the system Path variable
For Windows:
Press
Win + S
to open the search bar.Type "Environment Variables" and select "Edit the system environment variables" to open it.
In the System Properties window, click the "Environment Variables..." button.
In the Environment Variables window, under the "System variables" section, find and select the "Path" variable. Click "Edit."
Click "New" and add the path to the Flutter
bin
directory (e.g.,D:\Devs\flutter\bin
).Click "OK" to close each window.
Open a new Command Prompt or PowerShell window and run
flutter --version
to verify that Flutter is in the PATH.
macOS/Linux:
Open a terminal window.
Depending on your shell (bash, zsh, etc.), open the appropriate profile file. For example:
For bash:
nano ~/.bashrc
ornano ~/.bash_profile
For zsh:
nano ~/.zshrc
Add the following line at the end of the file to add Flutter to PATH:
export PATH="$PATH:/home/sirodevs/flutter/bin"
Replace
/home/sirodevs/flutter
with the actual path to your Flutter installation.Save the file (press
Ctrl + X
, thenY
, thenEnter
in nano).
You could also run this on your terminal as a shortcut to avoid opening the nano editor
echo 'export PATH="$PATH:/home/sirodevs/flutter/bin"' >> ~/.bashrc
Run
source ~/.bashrc
(orsource ~/.zshrc
) to apply the changes and reload the profile.Open a new terminal window and run
flutter --version
to verify that Flutter is in the PATH.
These instructions should help you add Flutter to the system PATH variable on your specific operating system. After completing these steps, you should be able to use Flutter commands from any directory in the terminal or command prompt.
user in plugdev group; are your udev rules wrong or error: insufficient permissions for device: udev requires plugdev group membership?
echo 'export ANDROID_SDK_ROOT="/home/sirodevs/Developer/Android/Sdk"' >> ~/.bashrc
This article is not finished yet, I will keep updating it and adjusting it as we go along.