Add Linux as a target platform for Flutter from Android start
To add Linux desktop as a Flutter app target, follow this procedure.
Install Linux compilation tools
#Allocate a minimum of 5 GB of storage for the Linux compilation tools.
To develop Linux desktop apps, use the following command to install these packages:
clang
,cmake
,ninja-build
,pkg-config
,libgtk-3-dev
,libstdc++-12-dev
sudo apt-get install \ clang cmake git \ ninja-build pkg-config \ libgtk-3-dev liblzma-dev \ libstdc++-12-dev
Check your development setup
#Run Flutter doctor
#The flutter doctor
command validates that all components of a complete Flutter development environment for Linux.
Open a shell.
To verify your installation of all the components, run the following command.
flutter doctor
As you chose to develop for Linux, you do not need all components. If you followed this guide, the result of your command should resemble:
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.5, on Ubuntu 20.04 (LTS), locale en)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[!] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] Linux toolchain - develop for Linux desktop
[✓] VS Code (version 1.95)
[✓] Connected device (1 available)
[✓] Network resources
! Doctor found issues in 1 categories.
Troubleshoot Flutter doctor issues
#When the flutter doctor
command returns an error, it could be for Flutter, VS Code, one of the Linux libraries, the connected device, or network resources.
If the flutter doctor
command returns an error for any of these components, run it again with the verbose flag.
flutter doctor -v
Check the output for other software you might need to install or further tasks to perform.
If you change the configuration of your Flutter SDK or its related components, run flutter doctor
again to verify the installation.
Start developing Linux desktop apps with Flutter
#Congratulations. Having installed all prerequisites and the Flutter SDK, you can start developing Flutter apps for Linux desktop.
To continue on your learning journey, consult the following guides:
Unless stated otherwise, the documentation on this site reflects the latest stable version of Flutter. Page last updated on 2024-04-12. View source or report an issue.