Table of Contents
Introduction
This tutorial will discuss installing Flutter on Windows, Mac OS, and Linux Operating Systems. The first Flutter project will also accompany this tutorial, so we can understand more about the Flutter Framework we will use.
Here you can see the difference: Flutter can already be multi-platform. We can program directly from Android Studio or use Microsoft Visual Studio Code in Fluter programming. Virtual devices can now use AVD (Android Virtual Device); we can use XCode for IOS applications.
The technology and framework itself attract a huge developer community in the world. Every software developer loses their head when they choose Flutter app development for their project. Therefore, Flutter has gained huge popularity in the software industry than any other framework. It’s the best framework that dominates the mobile app market. Some claim it’s the perfect answer from Google to Facebook’s React Native. But hold on! We are not here for any debate.
Code once, your application can be run directly on Android and IOS. Interesting right?
What is flutter?
Flutter is an open source framework developed and supported by Google. Frontend and full-stack developers use Flutter to build an application’s user interface (UI) for multiple platforms with a single codebase.
When Flutter launched in 2018, it mainly supported mobile app development. Flutter now supports application development on six platforms: iOS, Android, the web, Windows, MacOS, and Linux.
In the last few years of this decade, we have seen a lot of app startups emerging from all across the globe. With the rise in technology and the availability of smartphones, many startups find it easy to connect with users and clients via apps. The app market has also grown in the last few years and is expected to grow exponentially in the coming decade. The app development market has also been on a rise and has allowed countless app developers to exhibit their skills and find a suitable job. With this shift into apps, much development, and research have been done to deliver the best and to make the app development process faster and much simpler.
A library is basically a reusable piece of code that you put in your application to perform a particular function.
A framework is a structure that provides you with a skeleton architecture for building software. It’s a set of tools that serves as a foundation for your app, requiring you to fill in the blanks with your code to complete the entire structure and get the desired functionality.
An SDK has a much wider scope as it’s a collection of tools, including libraries, documentation, APIs, sometimes frameworks, and more, giving you all you need for software development. And that’s the case with Flutter -- it already contains everything necessary to build cross-platform applications.
How to install flutter in windows system?
To install and run Flutter, your Windows environment must meet these requirements:
Hardware requirements
requirement | Minimum | Recommended |
---|---|---|
x86_64 CPU Cores | 4 | 8 |
Memory in BG | 8 | 16 |
Display resolution in pixels | WXGA (1366 x 768) | FHD (1920 x 1080) |
Free disk space in BG | 11.0 | 60.0 |
Your Windows Flutter development environment must meet the following minimal hardware requirements.
Software requirements
Windows 10 operating system installed (Flutter will work on Windows 7 SP1 and later versions).
- At least 1.65 GB of free disk space (Additional free storage is needed for other tools and IDEs, if not already installed).
- Windows Powershell 5.0 or newer.
- Git for Windows version 2.0 or newer (Optional).
- Android Studio installed.
- Visual Studio 2022 with C++ (Optional).
How to install and configure flutter sdk on windows 10
You will be installing a fixed installation of Flutter SDK, without using Git.
Step 1: Download flutter sdk
Download the Flutter SDK package by clicking on the following button on the webpage.
Step 2: Extract the downloaded zip Files
Extract the downloaded zip file and move it to the desired location you want to install Flutter SDK. Do not install it in a folder or directory that requires elevated privileges, (such as C:\Program Files\) to ensure the program runs properly. For this tutorial, it will be stored in C:\development\flutter.
Step 3: Update path environment variables for windows powershell
Next, you need to update your Path environment variable to run Flutter commands in Windows consoles PowerShell and Command Prompt (CMD). First, click the Start button and type to search for and then click on Edit environment variables for your account.
Under User variables, click on and highlight Path. Click Edit.
On the next screen, click New and add the full path to your flutter\bin directory. For this guide, it is shown below. Click OK on both windows to enable running Flutter commands in Windows consoles.
Step 4: Confirm installed tools for running flutter
In CMD, run the flutter doctor command to confirm the installed tools along with brief descriptions.
C:\Users\tomz>flutter doctor
Running "flutter pub get" in flutter_tools... 8,9s
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19041.746], locale en-US)
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
'flutter config --android-sdk' to update to that location.
[√] Chrome - develop for the web
[X]] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (not installed)
[√] Connected device (2 available)
[√] HTTP Host Availability
! Doctor found issues in 3 categories.
As visible, several components still need to be installed to complete the installation.
Step 5: Download and install android studio
Continue by downloading Android Studio. In the setup, unless you have specific requirements, you can click Next on all screens leaving the default settings. Ensure that the Android Virtual Device option is selected on the Choose Components screen so that you can have an Android emulator running for Android app development.
Afterward, Android Studio Setup Wizard will start and you can proceed by clicking Next.
On the Install Type screen, select Custom and click Next.
Select the installation location or leave the default path and click Next.
Select your UI theme and click Next.
Select your SDK components and click Next.
Verify the selections and click Next.
On the next screen, accept the License Agreement and click Finish.
The download of the components will start and Android Studio install. Once completed, click Finish.
After the installation, start Android Studio. On the left side, click Plugins. Search for Flutter and click Install to install the Flutter plugin.
It will also prompt you to install Dart, a programming language used to create Flutter apps. Click Install at the prompt.
Finally, click Restart IDE so that the plugin changes are applied. Click Restart at the prompt to confirm this action.
Afterward, run the flutter doctorcommand in CMD to confirm the Android Studio installation.
C:\Users\princy>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [version 10.0.19041.746), locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++- workload, including all of its default components
[√] Android Studio (version 2021.1)
[√] Connected device (2 available)
[√] HTTP Host Availability
! Doctor found issues in 2 categories.
Android Studio was successfully installed, however, it finds an issue with Android licenses. This issue is fairly common and is mitigated by running the following command in CMD.
flutter doctor --android-licenses
When asked, input y to all prompts, to accept licenses.
C:\Users\princy>flutter doctor --android-licenses
5 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)? y
Running the flutter doctor command again shows the issue resolved.
C:\Users\princy>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19041.746], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
[√] Connected device (2 available)
[√] HTTP Host Availability
! Doctor found issues in 1 category.
How to install flutter in mac os?
To install and run Flutter, your Mac Os environment must meet these requirements:
Hardware requirements
Your Mac Os Flutter development environment must meet the following minimal hardware requirements.
requirement | Minimum | Recommended |
---|---|---|
CPU Cores | 4 | 8 |
Memory in BG | 8 | 16 |
Display resolution in pixels | WXGA (1366 x 768) | FHD (1920 x 1080) |
Free disk space in BG | 44.0 | 70.0 |
System requirements
To install and run Flutter SDK, on a macOS system it must fulfil these minimum requirements.
- Operating System: macOS 10.15 (Catalina) or later (64-bit)
- Disk Space: 3.5 Gb
- Tools: Git, IDE (Xcode includes git)
How to install and configure flutter sdk on macos
You will be installing a fixed installation of Flutter SDK, without using Git.
Step 1: Download flutter sdk
Download the Flutter SDK package by clicking on the following button on the webpage.
For other release channels, and older builds, check out the SDK archive and choose your needed sdk and download it.
The Flutter SDK should download to the macOS’s default download directory: ~/Downloads/.
Intel processor
Apple silicon
Step 2: Choose your installation directory or create a new one
Create a folder where you can install Flutter. Consider creating a directory at ~/flutterDevelopment/.
Step 3: Extract the downloaded zip file with the given command in your terminal
Extract the zip file into the directory you want to store the Flutter SDK.
$ unzip ~/flutterDevelopment/flutter_sdk_v1.0.0.zip -d ~/flutterDevelopment/
When finished, the Flutter SDK should be in the ~/flutterDevelopment/flutter directory.
Step 4: Add flutter to your environment path
To run Flutter commands in the Terminal, add Flutter to the PATH environment variable. This guide presumes your Mac runs the latest default shell, zsh. Zsh uses the .zshenv file for environment variables.
- Launch your preferred text editor.
- If it exists, open the Zsh environmental variable file ~/.zshenv in your text editor. If it doesn’t, create ~/.zshenv.
- Copy the following line and paste it at the end of your ~/.zshenv file.
export PATH=$HOME/flutterDevelopment/flutter/bin:$PATH
- Save your ~/.zshenv file.
- To apply this change, restart all open terminal sessions.
If you use another shell, check out this tutorial on setting your PATH.
Step 5: Check the status of sdk installation
Open a new terminal and test the Flutter SDK by entering the following command: flutter --version
The output should look similar to the following:
Flutter 3.19.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7482962148 (2 weeks ago) • 2024-02-27 16:51:22 -0500
Engine • revision 04817c99c9
Tools • Dart 3.3.0 • DevTools 2.31.1
When we see this output, we have successfully installed the Flutter SDK in our system!
How to install flutter in a linux system?
To install and run Flutter, your Linux Os environment must meet these requirements:
System requirements
- Operating System: Linux (64-bit)
- Disk Space: At least 1.6 GB (excluding disk space for IDE/tools).
- Tools: Flutter relies on these command-line tools:
- bash
- curl
- file
- git 2.x
- mkdir
- rm
- unzip
- which
- xz-utils
- zip
- Shared libraries: To utilize the flutter test command, your environment needs the library libGLU.so.1. The mesa packages provide this library: libglu1-mesa on Ubuntu/Debian and mesa-libGLU on Fedora.
To install the Flutter SDK on your Linux system, use one of the following methods.
Method 1: Install flutter using snapd
This offers the most direct method to install the Flutter SDK on your Linux system.
To learn about using snapd, check Installing snapd.
After you install snapd, install Flutter from the Snap Store or run the following command:
$ sudo snap install flutter --classic
Method 2: Manual installation
If you aren’t using snapd, follow these steps to install Flutter.
Download the installation bundle for the latest stable release of the Flutter SDK:
Step 1: Download flutter sdk
flutter_linux_3.19.3-stable.tar.xz
You can find older builds and other release channels in the SDK archive.
Step 2: Extract the downloaded zip file with given command in your terminal
Extract the downloaded file to a location of your choice:
cd ~/flutterDevelopment
$ tar xf ~/Downloads/flutter_linux_vX.X.X-stable.tar.xz
Step 3: Add flutter to your environment path
Add the flutter tool to your path:
$ export PATH="$PATH:`pwd`/flutter/bin"
This command sets your PATH environment variable for the current terminal window only. To add Flutter as permanent part of your path, check out Update your path.
(Optional) Pre-download development binaries:
$ flutter precache
To find additional download options, run flutter help precache.
Step 4: Check status of sdk installation
After installing Flutter, run flutter doctor.
$ flutter doctor
Review the output for further tasks to perform. An example would be the text shown in bold.
The flutter doctor -v output might resemble the following:
[-] Android toolchain - develop for Android devices
• Android SDK at /Users/dash/Library/Android/sdk
✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ
• Try re-installing or updating your Android SDK,
visit /setup/#android-setup for detailed instructions.
Conclusion
Now, you can create your first Flutter app using Android Studio and Microsoft Visual Studio code. The Flutter Tutorial is complete this time, starting from understanding Flutter, and installing it. You can already choose whether to use Android Studio or Visual Studio code. Please try both, and choose the most comfortable platform. With Flutter, app creation is faster. Because Flutter is equipped with default classes commonly used in mobile applications, we’ll try to create a simple application with Flutter in the following tutorial.