Home general postHow To Install Flutter on Ubuntu

How To Install Flutter on Ubuntu

Flutter 1536x803 1

Installing Flutter on Ubuntu 24.04 involves a series of steps to set up a powerful development environment for building cross-platform mobile applications.

Flutter, a popular open-source UI software development kit by Google, allows developers to create natively compiled applications for mobile, web, and desktop from a single codebase. This guide will walk you through the process of installing Flutter on your Ubuntu 24.04 system, ensuring that you have all the necessary tools and dependencies in place. By the end of this tutorial, you will be ready to start building and deploying your Flutter applications on Ubuntu.

Once the server is deployed, SSH into the command line interface. Before installing any packages, it’s essential to update your system’s package list to ensure you have access to the latest versions. Open a terminal and run the following command:

sudo apt-get update -y

 

Install Snap (if not already installed)

Ubuntu 22.04 comes with Snap pre-installed. However, if it’s not installed for some reason, you can install it using:

 

sudo apt install snapd

 

After the installation is complete, you can verify that Snap is installed and working correctly by checking its version:

snap --version

 

You should see output indicating the version of Snap that is installed.

 

Install Flutter

Use the following command to install Flutter via Snap:

sudo snap install flutter --classic

 

 

The –classic flag is necessary because Flutter requires classic confinement, which grants it full system access.

 

 

After the installation is complete, you need to set up Flutter. Run the following command to verify the installation and set up the environment:

flutter doctor

 

How to Install Android Studio on Ubuntu?

Building Your Own Nixie Tube Clock with HTML, CSS, and JavaScript

The flutter doctor command checks your environment and displays a report of the status of your Flutter installation. It may suggest additional software installations (e.g., Android Studio, Xcode, or additional dependencies).

Add Flutter to your PATH

Ensure that the Flutter SDK is in your system PATH. Snap usually handles this automatically, but you can manually add it if needed by adding the following line to your ~/.bashrc or ~/.zshrc file:

export PATH="$PATH:/snap/bin"

 

After adding this line, apply the changes using:

source ~/.bashrc

or

source ~/.zshrc

 

Validate Flutter Setup

Create and Run a Test Flutter Project:

 

Create a test project using the following command:

flutter create my_test_app

 

This command creates a new Flutter project named my_test_app.

 

Navigate to the Project Directory:

 

Move into the directory of the newly created Flutter project.

cd my_test_app

 

Run the test project:

 

This command builds and runs the Flutter application on the connected device or emulator. If everything is set up correctly, you should see the Flutter app running on the device or emulator.

flutter run

 

In conclusion, by following the outlined steps, you can ensure a smooth Flutter installation on Ubuntu 22.04, making it ready for seamless development. After installing Flutter via Snap and configuring your environment, it’s essential to verify the setup’s integrity.

Was this article helpful?
Yes0No0

Have any thoughts?

Share your reaction or leave a quick response — we’d love to hear what you think!

You may also like

Leave a Comment

Prove your humanity: 5   +   3   =  
* By using this form you agree with the storage and handling of your data by this website.