We imagine this is a separate git repo containing the information specifically for building the flatpak, as that is how an app is built for FlatHub.
Important configuration files are as follows:
com.example.FlutterApp.yml
-- Flatpak manifest, contains the Flatpak configuration and information on where to get the build filesbuild-flatpak.sh
-- Shell script that will be called by the manifest to assemble the flatpak
This should be built on an older version on Linux so that it will run on the widest possible set of Linux installations. Recommend docker or a CI pipeline like GitHub actions using the oldest supported Ubuntu LTS.
This is esentially what will happen when being built by FlatHub.
flatpak-builder --force-clean build-dir com.example.FlutterApp.yml --repo=repo
When this succeeds you can proceed to submit to an app store like Flathub.
The remainder is optional if we want to try installing locally, however only the first step is needed to succeed in order to publish to FlatHub.
This part is not done when building for FlatHub.
flatpak build-bundle repo com.example.FlutterApp.flatpak com.example.FlutterApp
Flatpak:
flatpak install --user com.example.FlutterApp.flatpak
flatpak list --app | grep com.example.FlutterApp
Flutter App com.example.FlutterApp 1.0.0 master flutterapp-origin user
If we search for "Flutter App" in the system application menu there should be an entry for the app with the proper name and icon.
We can also uninstall our test flatpak:
flatpak remove com.example.FlutterApp