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: in pubspec.yaml or flutpak.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

builtinSharedShPatch → const String
Patch content to replace pub upgrade with pub get --offline inside Flutter's shared.sh bootstrap function. Applied automatically when no explicit patchPath is given to FlutterSdkGenerator.
commitPlaceholder → const String
defaultSharedShPatchPath → const String
Default relative path (from the output dir) where the built-in patch is written when no explicit patchPath is 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/ to ref. Replaces the entire <screenshots> block in content with one built from screenshots config, using repoSlug and ref for 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.