Introduction
Flutter is an open-source UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase. If you are a Linux user, this guide will help you set up Flutter on your system and get started with your first Flutter project.
Table of Contents
- System Requirements
- Download Flutter SDK
- Install Flutter SDK
- Update Your PATH
- Install Additional Tools
- Run
flutter doctor
- Create and Run a Flutter App
- Conclusion
System Requirements
Before you begin, ensure your system meets the following requirements:
- Operating System: 64-bit version of Linux
- Disk Space: 600 MB (does not include disk space for IDE/tools)
- Tools: bash, curl, git 2.x, mkdir, rm, unzip, which, and xz-utils
Download Flutter SDK
- Visit the Flutter Website
- Go to the Flutter official website.
- Download the SDK
- Click the “Download Flutter SDK” button to get the latest stable release.
Install Flutter SDK
- Extract the TAR File
- Locate the downloaded TAR file and extract it to the desired location on your system (e.g.,
~/development/flutter
).
tar xf ~/Downloads/flutter_linux_<version>.tar.xz -C ~/development/
- Locate the downloaded TAR file and extract it to the desired location on your system (e.g.,
- Avoid Installation Locations with Spaces
- Ensure the installation path does not contain spaces (e.g., avoid
~/Program Files
).
- Ensure the installation path does not contain spaces (e.g., avoid
Update Your PATH
- Open Terminal
- Open the Terminal app.
- Update PATH Variable
- Add the Flutter
bin
directory to your PATH by modifying the.bashrc
or.zshrc
file:
nano ~/.bashrc
- Add the following line to the file:
export PATH="$PATH:$HOME/development/flutter/bin"
- Add the Flutter
- Apply Changes
- Save the file and apply the changes:
source ~/.bashrc
Install Additional Tools
- Android Studio
- Download and install Android Studio.
- Set Up Android SDK
- Open Android Studio and follow the setup wizard to install the necessary Android SDK components.
- Install Flutter and Dart Plugins
- In Android Studio, go to
File > Settings > Plugins
. - Search for and install the “Flutter” and “Dart” plugins.
- In Android Studio, go to
Run flutter doctor
- Open Terminal
- Open a new Terminal window.
- Run
flutter doctor
- Type
flutter doctor
and press Enter. - Review the output and follow any additional setup instructions.
flutter doctor
- Type
Create and Run a Flutter App
- Create a New Project
- In the Terminal, navigate to your development directory and create a new Flutter project:
flutter create my_first_app
- Navigate to the Project Directory
- Change to the project directory:
cd my_first_app
- Run the App
- Ensure an Android emulator is running or a physical device is connected.
- Run the app using the following command:
flutter run
Conclusion
By following these steps, you have successfully set up Flutter on your Linux machine and run your first Flutter app. For more detailed information and troubleshooting, refer to the official Flutter documentation. Happy coding!
you’re actually a good webmaster. The web site loading speed is amazing. It sort of feels that you’re doing any distinctive trick. In addition, The contents are masterwork. you’ve performed a excellent activity on this topic!
Generally I do not read post on blogs, but I wish to say that this write-up very forced me to try and do it! Your writing style has been surprised me. Thanks, very nice post.