DEV Community

Cover image for Package Flutter Linux App Into AppImage Part 1
Hosam Hasan
Hosam Hasan

Posted on

Package Flutter Linux App Into AppImage Part 1

Flutter is one of the fastest-growing cross-platform UI frameworks with a great and powerful community which has a great part of Flutter success.

assets.ubuntu.com/v1/29985a98-ubuntu-logo32.png

Lately, Flutter announced desktop support including Linux which got the attention of big corporates like Canonical (Publisher of Ubuntu), and lately announced that they are rebuilding Ubuntu Desktop Installer using Flutter.

Flutter official docs also have a section on how to build and package Flutter Linux app in Snap (Linux Universal Package Manager) and ship it to Snap Store. here

So it will be interesting if we tried to package Flutter Apps using another universal package manager which is AppImage.

Requirments :

  • Linux OS (I will use Manjaro)

  • Flutter with Linux config enabled ( assuming you have latest flutter stable version )

  • AppImage Tool

  • AppImage Builder

Install AppImage Tool and AppImage Builder

1- Install required deps

$ sudo pacman -Sy python-pip python-setuptools binutils patchelf desktop-file-utils gdk-pixbuf2 wget fakeroot strace
Enter fullscreen mode Exit fullscreen mode

2 - Install Apimage Tool

$ sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
$ sudo chmod +x /usr/local/bin/appimagetool
Enter fullscreen mode Exit fullscreen mode

3 - Install AppImage Builder

sudo pip3 install appimage-builder
Enter fullscreen mode Exit fullscreen mode

Create and build Flutter Linux app

1 - install required deps for building flutter linux app

sudo pacman -Sy clang cmake ninja pkgconf gtk3
Enter fullscreen mode Exit fullscreen mode

2 - Enable Flutter linux desktop configuration

$ flutter config --enable-linux-desktop
Enter fullscreen mode Exit fullscreen mode

3 - Create flutter project flutter_appimage

$ flutter create flutter_appimage
Enter fullscreen mode Exit fullscreen mode

3 - Build Linux App

$ (cd flutter_appimage && flutter build linux) 
Enter fullscreen mode Exit fullscreen mode

Now, We are good to go to build the AppImage 🥳

Top comments (1)

Collapse
 
flaxalex57 profile image
alexif57

I have successfully created my first .AppImage for my software, following this tutorial : How to create an AppImage to bundle your software this was done on Ubuntu Linux