- Prerequisites
- Step 1: Install Flutter SDK
- Step 2: Set Up Environment Variables
- Step 3: Install Dart SDK
- Step 4: Install Visual Studio Code Extensions
- Step 5: Additional Setup for Android Development
- Step 6: Additional Setup for iOS Development (macOS only)
- Verifying the Installation
This guide will walk you through the steps to set up Flutter on your Windows or macOS system for iOS and Android development. Please follow the instructions carefully.
Note:
This tutorial is based on the official Flutter documentation: https://flutter.dev/docs/get-started/install. You should check the documentation for more information.
This tutorial is for Windows and macOS only. If you are using Linux, please refer to the official documentation: https://flutter.dev/docs/get-started/install/linux.
Before you begin, ensure that you have the following software installed on your system:
- Flutter SDK (latest version)
- Dart SDK (included with Flutter)
- Visual Studio Code (VSCode) or any other preferred code editor
- Xcode (developing for iOS/macOS - 🛎️ available only on macOS 🛎️)
- Android Studio (developing for Android's latest version)
- Visit the Flutter website: https://flutter.dev.
- Click on the "Get Started" button.
- Select your operating system (Windows, macOS).
- Download the Flutter SDK for your respective operating system.
- Extract the downloaded ZIP file to a desired location on your system.
Windows users:
C:\Program Files\
that requires elevated privileges.
- Open the Start menu and search for
environment variables.
- Click on "Edit the system
environment variables
." - In the System Properties window, click on the
Environment Variables
button. - Under User variables, check if there is an entry called Path:
- If the entry exists, append the full path to
flutter\bin
using;
as a separator from existing values. - If the entry doesn't exist, create a new user variable named path with the full path to
flutter\bin
as its value.
- If the entry exists, append the full path to
- Click "OK" to save the changes.
- Open Terminal.
- Run the following command to open the Bash profile file:
open ~/.bashrc.
- Add the following line to the file and save it:
export PATH="$PATH:[PATH_TO_FLUTTER_SDK]/bin"
- Close and reopen the terminal for the changes to take effect.
Since the Dart SDK is bundled with Flutter, you don't need to install it separately.
- Open Visual Studio Code (VSCode).
- Open the Extensions view by clicking on the square icon on the left sidebar or pressing
Ctrl+Shift+X.
- Search for the
Flutter
extension. - Click on the "Install" button to install the extension.
- This will also install the
Dart
extension.
-
Download and install Android Studio from the official website: https://developer.android.com/studio.
-
Launch Android Studio and follow the installation wizard to set up the necessary components.
-
open Android Studio's SDK Manager once the installation is complete.
-
Ensure that the following components are installed:
- Android SDK
- Android SDK Platform
- Android Virtual Device (AVD)
- Intel x86 Emulator Accelerator (HAXM installer)
-
If you wish to develop Flutter applications using the Android Studio IDE, install the Flutter and Dart plugins.
-
On the main screen, click
plugins,
search forflutter,
and install the Flutter extension. It will also install theDart
extension
- Install Xcode from the Mac App Store.
- Launch Xcode and accept the license agreement.
- Install additional components prompted by Xcode.
- Run the following command in the terminal to install Xcode command line tools:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
. - Launch Xcode and go to "Preferences"> "Locations."
- Ensure the "Command Line Tools" option is selected for your installed Xcode version.
To verify that Flutter is set up correctly, run the following command in the terminal:
flutter doctor
This command will check for any missing dependencies or some missing configurations and guide you on how to resolve them.
Congratulations! You have successfully set up Flutter for iOS and Android development on your Windows or macOS system.