Linux Desktop app with Flutter | Publish on Snapcraft Tutorial
Flutter is Google’s UI framework to make apps for Android, iOS, Web, Windows, Mac, Linux, and Fuchsia OS. Since the last 2 years, the flutter Framework has already achieved popularity among mobile developers to develop Android and iOS apps. In the last few releases, Flutter also added the support of making web applications and desktop applications.
Introduction
Flutter Desktop is now in alpha release and recently Canonical enables Linux desktop app support with Flutter in Linux distribution including Ubuntu. By this Linux support in Flutter, it’s easy for developers to publish their apps for Linux users also via Snapcraft Store.
In this article, I will tell you how to publish your own Linux Desktop app in Flutter on Snapcraft SnapStore. I am going to use the default Sample Counter Application created by Flutter.
Note: Flutter Desktop is not stable yet, so you might face some issues or app crashes.
1. Install Flutter SDK on Ubuntu
There are many methods to set up this on Linux but this is one of them. Type command
snap install flutter
2. Enable Flutter Desktop in Flutter SDK
Currently, Flutter is in stable channel we need to switch to master channel using command
flutter channel master
To support flutter desktop in flutter SDK you need to enable desktop config using:
flutter config --enable-linux-desktop
NOTE: After completing above steps make sure your update flutter SDK flutter upgrade
To make Flutter Desktop run on Linux you will also need Linux toolchain