flutpak library

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 by fetching metadata from the Flutter GitHub repository at flutterRef.
ForeignDepsRegistry
Resolves package dependencies from the flutpak foreign_deps registry, compatible with the flatpak-flutter foreign_deps.json format.
ForeignDepsResult
Result returned by ForeignDepsRegistry.resolve.
GenerateCommand
Generates the Flatpak generated/ output from an existing template manifest.
GitSource
IconEntry
An icon entry specifying the size and source path of an icon asset.
InitCommand
One-time initialisation: generates the template manifest, wrapper script, and .gitignore, then immediately runs generate to populate generated/.
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.
PatchSource
PubSourcesGenerator
ScreenshotConfig
Config for a screenshot entry in metainfo.
ScriptSource
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.
defaultSharedShPatchPath → const String
Default relative path (from the output dir) where the built-in patch is written when no explicit patchPath is provided.

Functions

buildLockPaths({required List<String> effectiveLocks, required List<String> extraPubspecPaths, required List<String> cargoLockPaths, required List<String> rustLocks, required String baseDir}) → ({List<String> allCargoLockPaths, List<String> allPubLockPaths})
Merges effective pub locks with extra pubspec paths from the registry and cargo lock paths from the registry + explicit config entries.
convertPatchToCrlf(String content) String
Converts content (a unified diff) to CRLF line endings.
convertPatchToLf(String content) String
Converts content (a unified diff) to LF line endings.
injectGeneratedContent({required String content, required ManifestConfig manifestCfg, required List<Object> extraModules, required String sourcesPath, String? cargoSourcesPath, String? flutterSdkModule, String? rustupModule, String? rustupPath, required String? tag, required String? commit}) String
Injects tag/commit, modules, sources, and Rust/Cargo artifacts into the manifest YAML using yaml_edit.
patchHasLfLineEndings(String content) bool
Returns true if content contains at least one bare \n not preceded by \r, i.e. the string has LF line endings.
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.
resolveFlutterRef(String? ref, {Client? client}) Future<String>
Resolves a symbolic Flutter ref to a concrete version tag.
stripTemplateGuidance(String content) String
Strips template-only guidance comments from content before writing the generated manifest.