Setting up Flutter
Learn how to set up Flutter
Setting up Flutter
In this submodule, we will guide you through the process of setting up Flutter on your machine. Flutter is an open-source UI software development kit created by Google, which allows developers to build applications for mobile, web, and desktop from a single codebase.
Prerequisites
Before you start, make sure you have the following installed:
- Git: Flutter uses Git for installation and upgrade. You can get Git from https://git-scm.com/.
- An IDE: You can use Android Studio, IntelliJ IDEA, or Visual Studio Code.
Steps to Set Up Flutter
Download the Stable Flutter SDK
Navigate to the Flutter's official website https://flutter.dev, click on get started, then select the appropriate operating system to download the stable Flutter SDK.
Extract the Flutter SDK
After downloading, extract the zipped folder to an appropriate location on your system.
Update your PATH
To run the Flutter commands from your terminal, you need to update your PATH. The process varies depending on your Operating System.
- For Windows, you can do this via the System Environment Variables option.
- For Mac/Linux, you can directly add the following line to your `.bashrc`, `.zshrc` or `.bash_profile` file:
```
export PATH="$PATH:`pwd`/flutter/bin"
```
Run Flutter Doctor
The flutter doctor checks your environment and displays a report of the status of your Flutter installation. Run the following command in your terminal:
flutter doctor
The command checks for any dependencies you may still need to install.
Install IDE and Flutter/Dart Plugins
Flutter supports three IDEs: VS Code, Android Studio, and IntelliJ. After you've chosen and installed your preferred IDE, you will need to install Flutter and Dart plugins.
- For Android Studio and IntelliJ, navigate to 'Configure' -> 'Plugins', then search and install the Flutter and Dart plugins.
- For VS Code, navigate to the Extensions View (Ctrl+Shift+X), then search and install the Flutter and Dart extensions.
Create a New Flutter Project
To create a new project, you can use the following command:
flutter create my_app
This creates a project called
my_app
.Run your Flutter App
Navigate to your project directory and run the following command:
flutter run
Congratulations! You've set up Flutter on your machine and are ready to start developing amazing applications!