Making and submitting an App built with Flutter and SqLite

Hi, I have an app that I released in win, macos, ios, android, and appimage.

I’d like to release a flatpak, but I’m quite intimidated to do this.

Is there someone who can help me?
I have a build script for building Appimages and even github workflows.
There is a db that needs to be downloaded unziped and then a bash file needs to be run (this is done in workflows).
There will need to be a dependency for libsqlite3-dev

I’ve gone through the oversimplified example , but I’m still not certain how to make this happen.
Is there anyone who would like to help?
You can look at the workflows to see the build commands.


Hi @bksubhuti,

There are three Flutter apps that I helped bring to Flathub — Feeel, Parlera, and Time Cop. You can take a look at the manifests for those; Feeel uses SQlite for now, so it’s particularly relevant.

The idea is to pre-compile the app and then just ship binaries as part of the Flatpak.

I built each of those Flatpaks manually. However, I am working on automating builds through Github Actions. The first project that I’m building this way is Parlera — see:

I’m automating it to the point of creating the x86_64 Github release. Then I manually still upload the ARM builds and the Flathub manifest file. However, if you forgo the ARM builds (or if you pay extra for Linux ARM VMs on Github), the Flathub manifest could also be automated away — see wger for inspiration for that.

This automation is a brand new for me, and I’m currently getting stuck at the “Check for AppStream XML” step for some reason. I’m doubtful that the automation is at fault here, though.

I know this was a mouthful, so let me know if you have specific questions that I could help with.

I appreciate you answering my question. This post was created aeons ago, but I edited to resurrect my unanswered question.

Perhaps I’m lost when you use the dart flatpak_packager
linux (nor windows) does not really produce a single file so i’m not sure what “binary” to use.

I also don’t understand where to put dependencies, like libsqlite3-dev
OK… i see your manifest link which has that.
However, there is a gz that is listed as source. I don’t understand… do you just tarball your app? what about flatpakbuilder?

I’m quite happy pressing a button and having my action take place.
It would be better if there was a simple tutorial without fancy stuff.
Another or the only example out there is from a person name merit, who says you need to create a container. I don’t think so…

If you can help I’d appreciate it.
if you can make a simple counter app and fake put the dependency of sqlite, I would be very happy, and heck… publish it on the mainstream too (if allowed).

snaps totally smell plus they don’t work with my build. They make everything automatic and there is zero support. When snap desktops are required, that is when everyone will stop using ubuntu. I’m quite sure of that.

There’s two ways to go about this — manual and partly automated (through the Dart scripts).

The manual way is just creating the tarball + Flatpak manifest.

The tarball is made up of:

  1. Your binary = the contents of ./build/linux/x64/release/bundle (if you’re building for the x86_64 architecture) inside your Flutter project folder. You generate this via flutter build linux --release.
  2. The desktop file, which you create manually.
  3. The AppStream metainfo file, which you also create manually.
  4. Desktop icons, which is also a manual job.
  5. (Anything else you need to include that isn’t part of the compiled binary.)

You should upload this tarball somewhere where others can easily download it — e.g. as a Github Release.

Once you’re done with that, you also need to create the Flatpak manifest manually — see the official tutorial for how to do that.

If you use SQlite and are building just for the x86_64 architecture, you need to include this command as part of your build commands in your manifest:

ln -s /usr/lib/x86_64-linux-gnu/ /app/lib/

I’d recommend doing things this way first before you try to automate things.

Let me know how it goes!

This is what I was looking for. Surely I have to understand manual before I can think of other items.

I really appreciate your help. libfuse2 has been giving many appimager devs many problems… In fact… if you install fuse it will install fuse3… that will crash Ubuntu. Flatpak seems to be the solution, but I’m not so easy to understand the instructions they have.

Perhaps you can do a PR especially for flutter builds on the flatpak help.

I’m building on Lubuntu… Will my app look like lubuntu?
I see you add a bunch of wayland and other stuff in the feeel app. Do I need that or just sqlite3
We also need network access for extensions download (to add more books and dictionaries). Is that blocked in flatpak by default?
Android no longer cares about this permission anymore.

Since it’s Flutter, your app does not use the GTK theme, except possibly for the headerbar. (I personally replace the headerbar with a standard title bar in my Flutter apps, so I have no idea how those behave.)

As for permissions, they’re described in the Flatpak documentation. --share=network is the one you want for network access. The other common ones, which you will likely need, are described there as well.

I rebuilt my linux with more space and Mate 22.04 so it took a while.

I got it to work now with internet access and it appears that the database is working at least on my machine. There was just a few things that needed help. The main thing was that I downloaded your archive and noticed there was a bin/ directory. That changed most of it.

I appreciate your help. Your file did work.
The next step (not totally solved)… is to get the icons and desktop file to work as well as submitting to the store.
For those who are reading now:
The gz file needs a bin directory and you put flutter stuff and appExe inside. Best to download his gz file to understand.


My yml file looks like this so far:
This is a combo of the hello.yml and @mirek and his feel yml.

type: Archive automatically knows to decompress the gz and dest can give the human readable directory name… (it should be in quotes).

app-id: org.flatpak.TipitakaPaliReader
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
command: tipitaka_pali_reader
separate-locales: false
  - --share=ipc
  - --socket=fallback-x11
  - --socket=wayland
  - --device=dri
  - --share=network
  - name: tipitaka_pali_reader
    buildsystem: simple
      - cp -R tpr/bin/ /app/tpr
      - chmod +x /app/tpr/tipitaka_pali_reader
      - mkdir /app/bin/
      - mkdir /app/lib/
      - ln -s /app/tpr/tipitaka_pali_reader /app/bin/tipitaka_pali_reader
      - ln -s /usr/lib/x86_64-linux-gnu/ /app/lib/
      - if [ ! -e '/app/lib/' ]; then ln -s -f /usr/lib/aarch64-linux-gnu/ /app/lib/; fi
#      - if [ $(arch)="aarch64"  ]; then sed -si "/Exec=/cExec=env LIBGL_ALWAYS_SOFTWARE=1 tipitaka_pali_reader" tipitaka_pali_reader/org.flatpak.tipitakaPaliReader.desktop; fi
      - type: archive
        path: tpr.tar.gz
        dest: "tpr"

I gave up… I’m looking to keep Appimages as my only linux release… It works. It is easy. It should only be like that. Furthermore, flatpak was an option for the current fuse3 woes. They will now statically link a small forked version of that. I’ll look into Flatpak again later when it is more friendly and more people request it.

It is just too much time and no progress. I should be able to just build it. I encourage the Flatpak team to make a flutter package to do so. That is the way.

We can’t make packages for every app ecosystem there is, that’s not realistic. Even getting electron to be fine is a lot of work. (mostly not done by the Flatpak team)

And flutter is especially worse, as far as others are telling, due to how problematic building stuff is.