GithubHelp home page GithubHelp logo

antonfranzluebbers / flutter_flatpak_example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from merrit/flutter_flatpak_example

0.0 0.0 0.0 148 KB

An example of how to package a Flutter application as a Flatpak for distribution on Linux, using the default counter example app.

C++ 41.34% C 2.82% Objective-C 0.08% Kotlin 0.28% Dart 10.93% Swift 0.80% HTML 7.82% CMake 35.95%

flutter_flatpak_example's Introduction

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

The necessary configuration files are in the root of the repository for ease of demonstration:

  • com.example.FlutterApp.desktop -- desktop menu / icon integration
  • icon.svg -- app's icon
  • com.example.FlutterApp.json -- Flatpak manifest, instructions on how to build / assemble the flatpak
  • com.example.FlutterApp.metainfo.xml -- AppStream metadata file that contains the information about the app that would be presented on an app store like Flathub

Requirements

  • flatpak
  • flatpak-builder

On ubuntu:

sudo apt install flatpak flatpak-builder

Also required: Flathub setup

Instructions

Note: Building a flatpak should be done in a predictable environment or it may fail.

There is a GitHub action 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, and install the .flatpak file it generates with flatpak install <path-to-.flatpak>.

Get Flutter project dependencies:

flutter pub get

Build linux version:

flutter build linux

Compress linux build:

tar -C build/linux/x64/release/bundle -cvf FlutterApp-Linux-Portable.tar.gz .

Instruct flatpak-builder to use the manifest to do a flatpak build:

flatpak-builder --force-clean build-dir com.example.FlutterApp.json

Publish to app store

When this succeeds you can proceed to submit to an app store like Flathub.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.