flutpak library
Flatpak source manifest generator for Flutter/Dart applications.
Provides generators for:
- Dart pub package sources (from pubspec.lock, using pub.dev API)
- Flutter SDK sources (from a local Flutter install, cached SHA-256)
- Combined generated-sources.json for offline Flatpak builds
- Flathub SDK Extension manifest for distributing Flutter SDK
Classes
- ArchiveSource
- DeveloperConfig
-
Developer info for metainfo
<developer>element. - DownloadCache
- Interface for SHA-256 resolution — injectable for testing.
- FileSource
- FlatpakGenConfig
-
Parsed contents of
flutpak:inpubspec.yamlorflutpak.yaml. - FlatpakSource
- FlutterSdkGenerator
- Generates Flutter SDK FlatpakSource entries from a local Flutter SDK install.
- GitSource
- InlineSource
- LocalDownloadCache
- SHA-256 cache keyed by URL — avoids re-downloading Flutter SDK artifacts across runs. Stored in ~/.cache/flutpak/.
- ManifestConfig
-
Config for manifest generation (
flutpak.manifest:section). - ManifestGenerator
- Generates a Flatpak application manifest YAML from ManifestConfig.
- PatchEntry
- A project-level patch entry: applies a patch file to a specific pub package.
- PatchSource
- PubSourcesGenerator
- RegistryEntry
- A registry entry describing how to patch a known pub package for Flatpak.
- ScreenshotConfig
- Config for a screenshot entry in metainfo.
- ScriptSource
- SdkExtensionGenerator
- Generates a Flathub SDK Extension manifest for Flutter.
- UrlConfig
- Homepage / issue tracker URLs for metainfo.
Constants
-
Patch content to replace
pub upgradewithpub get --offlineinside Flutter's shared.sh bootstrap function. Applied automatically when no explicitpatchPathis given to FlutterSdkGenerator. - commitPlaceholder → const String
-
Default relative path (from the output dir) where the built-in patch is
written when no explicit
patchPathis provided. - tagPlaceholder → const String
Functions
-
patchManifestPlaceholders(
String content, {required String commit, String? tag}) → String - Updates tagPlaceholder / commitPlaceholder in a manifest's raw YAML text.
-
patchMetainfoReleases(
String content, String tag, DateTime date) → String -
Updates the first
<release .../>entry inside<releases>in a metainfo XML file. -
replaceMetainfoScreenshots(
String content, {required List< ScreenshotConfig> screenshots, required String repoSlug, required String ref}) → String -
Pins screenshot URLs in a metainfo XML file from
/main/toref. Replaces the entire<screenshots>block incontentwith one built fromscreenshotsconfig, usingrepoSlugandreffor URLs. -
resolvePatchEntries(
{required List< String> lockPaths, String patchesDir = 'flatpak/patches', List<PatchEntry> projectPatches = const []}) → List<PatchEntry> -
Resolves patch entries from the registry for packages found in
lockPath.