{"id":50558061,"url":"https://github.com/meta-flutter/flatpak_dart","last_synced_at":"2026-06-04T09:01:21.694Z","repository":{"id":354093855,"uuid":"1194882764","full_name":"meta-flutter/flatpak_dart","owner":"meta-flutter","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-01T04:32:58.000Z","size":538,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T06:24:27.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meta-flutter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-28T23:50:54.000Z","updated_at":"2026-03-30T17:57:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meta-flutter/flatpak_dart","commit_stats":null,"previous_names":["meta-flutter/flatpak_dart"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/meta-flutter/flatpak_dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-flutter%2Fflatpak_dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-flutter%2Fflatpak_dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-flutter%2Fflatpak_dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-flutter%2Fflatpak_dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meta-flutter","download_url":"https://codeload.github.com/meta-flutter/flatpak_dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-flutter%2Fflatpak_dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33897568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-04T09:01:20.677Z","updated_at":"2026-06-04T09:01:21.689Z","avatar_url":"https://github.com/meta-flutter.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flatpak_dart\n\nTyped Dart API for managing Flatpak applications on Linux. Drives\n**libflatpak** directly via a C++23 FFI bridge — no D-Bus client library,\nno subprocess spawning, no text parsing.\n\n## Features\n\n| Feature | API |\n|---------|-----|\n| List installed apps | `client.listApplications()` |\n| App details | `client.info(appId)` |\n| Install / update / uninstall | `client.install()`, `.update()`, `.uninstall()` |\n| Transaction progress | `tx.progress` stream (percentage, bytes, status) |\n| Batch transactions | `client.transaction()..addInstall()..addUpdate()` |\n| Remote CRUD | `client.remotes.add()`, `.modify()`, `.remove()` |\n| Remote browsing | `client.remotes.listApps(name)` stream |\n| Subset filtering | `client.remotes.modifySubset(name, RemoteSubset.verified)` |\n| Pre-install permissions | `client.fetchRemoteMetadata(remote, ref)` |\n| Update monitoring | `client.watchUpdates()` (inotify, state-diffed) |\n| Known remotes catalog | `KnownRemotes.flathub`, `.fedora`, `.gnomeNightly`, etc. |\n\n## Architecture\n\n```\nDart isolate\n  |  FFI call (\u003c 1 us)\n  v\nC++23 bridge (libflatpak C API)\n  |  flatpak_installation_*()  — reads\n  |  flatpak_transaction_run() — writes (serial worker queue)\n  |  GFileMonitor              — update watch (inotify)\n  v\nResults posted to Dart via Dart_PostCObject_DL (kTypedData)\nPayloads encoded with BEVE-Lite binary codec (glaze_meta.h)\n```\n\n## Prerequisites\n\n```bash\n# Fedora\nsudo dnf install flatpak-devel glib2-devel cmake ninja-build clang\n\n# Ubuntu / Debian\nsudo apt install libflatpak-dev libglib2.0-dev cmake ninja-build clang-19\n```\n\n## Quick start\n\n```bash\n# Clone\ngit clone https://github.com/jwinarske/flatpak_dart.git\ncd flatpak_dart\n\n# Build the native library\n./scripts/build_release.sh\n\n# Install Dart dependencies\ndart pub get\n\n# Run an example\nFLATPAK_NC_LIB=build-release/libflatpak_nc.so dart run example/example.dart\n```\n\n## Usage\n\n```dart\nimport 'package:flatpak_dart/flatpak_dart.dart';\n\nvoid main() async {\n  final client = FlatpakClient.user();\n\n  // List installed apps\n  for (final app in await client.listApplications()) {\n    print('${app.ref.name} ${app.appDataVersion}');\n  }\n\n  // Install with progress\n  final tx = client.install('flathub', 'app/org.gnome.Calculator/x86_64/stable');\n  await for (final p in tx.progress) {\n    print('${p.progressPercent}% ${p.progressLabel}');\n  }\n  await tx.result;\n\n  // Pre-install permissions check\n  final perms = await client.fetchRemoteMetadata(\n      'flathub', 'app/org.gnome.Calculator/x86_64/stable');\n  for (final e in perms.where((e) =\u003e e.section == 'Context')) {\n    print('${e.key}: ${e.value}');\n  }\n\n  // Watch for changes (inotify)\n  final monitor = client.watchUpdates();\n  await for (final _ in monitor.events) {\n    print('Installation changed!');\n  }\n\n  await client.close();\n}\n```\n\n## Remote management\n\n```dart\nfinal client = FlatpakClient.user();\n\n// Add from known catalog\nawait client.remotes.add('flathub', KnownRemotes.flathub);\nawait client.remotes.add('flathub-floss', KnownRemotes.flathubFloss);\n\n// Browse remote packages\nawait for (final ref in client.remotes.listApps('flathub')) {\n  print('${ref.name}/${ref.arch}/${ref.branch}');\n}\n\n// Enable / disable\nawait client.remotes.disable('flathub-floss');\nawait client.remotes.enable('flathub-floss');\n\n// Remove\nawait client.remotes.remove('flathub-floss');\n```\n\n## Transaction concurrency\n\nTransactions on the same installation are serialized by an internal worker\nqueue (OSTree holds an exclusive repo lock). User and system installations\nhave independent queues and run in parallel.\n\n```dart\nfinal user   = FlatpakClient.user();\nfinal system = FlatpakClient.system();\n\n// These run in parallel (different repo locks)\nawait Future.wait([\n  user.install('flathub', 'app/org.gnome.Calculator/x86_64/stable').result,\n  system.install('flathub', 'app/org.gnome.Maps/x86_64/stable').result,\n]);\n```\n\n## Known remotes\n\n| Constant | Remote | Notes |\n|----------|--------|-------|\n| `KnownRemotes.flathub` | Flathub | Default, collection `org.flathub.Stable` |\n| `KnownRemotes.flathubVerified` | Flathub | `--subset=verified` |\n| `KnownRemotes.flathubFloss` | Flathub | `--subset=floss` |\n| `KnownRemotes.flathubVerifiedFloss` | Flathub | `--subset=verified_floss` |\n| `KnownRemotes.flathubBeta` | Flathub Beta | Pre-release channel |\n| `KnownRemotes.fedora` | Fedora | OCI format (`oci+https://`) |\n| `KnownRemotes.elementaryOs` | elementary | AppCenter |\n| `KnownRemotes.gnomeNightly` | GNOME Nightly | Nightly builds |\n| `KnownRemotes.kdeRuntimeNightly` | KDE Nightly | KDE runtime |\n\n## Building the native library\n\nThe package includes a C++23 shared library that bridges Dart FFI to libflatpak.\n\n```bash\n# Release build\n./scripts/build_release.sh\n\n# ASAN + UBSan\n./scripts/asan.sh\n\n# clang-tidy\n./scripts/clang_tidy.sh\n\n# Coverage\n./scripts/coverage.sh\n```\n\nSet `FLATPAK_NC_LIB` to the path of `libflatpak_nc.so`, or place it in one\nof the auto-detected paths (`build-release/`, `build/`, etc.).\n\n## Flutter example\n\nA full Flutter Linux desktop app is included in `example/flutter_remote_manager/`:\n\n```bash\ncd example/flutter_remote_manager\nflutter pub get\nFLATPAK_NC_LIB=../../build-release/libflatpak_nc.so flutter run -d linux\n```\n\n## Platform support\n\n| Platform | Support |\n|----------|---------|\n| Linux (x86_64, aarch64) | Full |\n| macOS / Windows | Not supported (Flatpak is Linux-only) |\n\nRequires libflatpak \u003e= 1.12 and Flatpak installed on the host.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n\nVendored headers are under their respective licenses.\nSee [THIRD_PARTY_LICENSES](THIRD_PARTY_LICENSES).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-flutter%2Fflatpak_dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeta-flutter%2Fflatpak_dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-flutter%2Fflatpak_dart/lists"}