https://github.com/merrit/flutter_flatpak_example
An example of how to package a Flutter application as a Flatpak for distribution on Linux, using the default counter example app.
https://github.com/merrit/flutter_flatpak_example
flathub flatpak flutter linux
Last synced: 3 months ago
JSON representation
An example of how to package a Flutter application as a Flatpak for distribution on Linux, using the default counter example app.
- Host: GitHub
- URL: https://github.com/merrit/flutter_flatpak_example
- Owner: Merrit
- License: mit
- Created: 2022-02-25T21:36:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T16:17:52.000Z (9 months ago)
- Last Synced: 2025-03-16T14:49:50.690Z (3 months ago)
- Topics: flathub, flatpak, flutter, linux
- Language: CMake
- Homepage:
- Size: 152 KB
- Stars: 69
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
- [Flutter Flatpak Example](#flutter-flatpak-example)
- [Requirements](#requirements)
- [VSCode dev container](#vscode-dev-container)
- [GitHub actions](#github-actions)
- [Manual Requirements](#manual-requirements)
- [Instructions](#instructions)# Flutter Flatpak Example
An example of how to package a Flutter application as a Flatpak for distribution
on Linux, using the default counter example app.[Flatpak documentation](https://docs.flatpak.org/en/latest/index.html)
## Requirements
> Note: Building a flatpak should be done in a predictable environment or it may
> fail.[Set up Flathub](https://flatpak.org/setup/), and choose one:
### VSCode dev container
Use the VSCode dev container provided in this repo that will run everything
through Docker1. Install the [Dev
Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
extension
2. Open this directory in VSCode.3. Accept the prompt to re-open in the dev container, or from the Command
Palette search for `Reopen in Container`### GitHub actions
> There is a [GitHub
> action](https://github.com/bilelmoussaoui/flatpak-github-actions) for this
> purpose, which is demonstrated in this repo. This action's page also lists the
> docker containers it uses.
>
> If you fork this example repo you can run the [example workflow](https://github.com/Merrit/flutter_flatpak_example/blob/main/.github/workflows/flatpak.yml), and
> install the `.flatpak` file it generates with `flatpak install `.### Manual Requirements
Install flatpak and flatpak-builder
On ubuntu:
```bash
sudo apt install flatpak flatpak-builder
```Add the FlatHub repo:
```bash
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```Install flatpak build dependencies:
```bash
flatpak install -y org.freedesktop.Sdk/x86_64/22.08
flatpak install -y org.freedesktop.Platform/x86_64/22.08
flatpak install -y flathub org.freedesktop.appstream-glib
```## Instructions
We have two directories that each represent what would be separate git
repositories for a real project:[counter_app](counter_app/) is the Flutter app, view the README there for info on
configuration and building.[flathub_repo](flathub_repo/) is separate from the Flutter app and is where the Flatpak is
assembled, view the README there for info on configuration, building, and
publishing of the flatpak after building the `counter_app`.