Skip to main content

work_vault 0.5.0 copy "work_vault: ^0.5.0" to clipboard
work_vault: ^0.5.0 copied to clipboard

Resumable HTTPS GET downloads for Flutter across Android, iOS, macOS, Windows, Linux, and Web.

0.5.0 #

  • Security: the desktop engine (Windows, macOS, Linux) no longer accepts every TLS certificate. It installed a badCertificateCallback that returned true, so a man-in-the-middle could serve any file. Certificates are now checked against the platform trust store, and a download from a server with an untrusted or self-signed certificate fails.
  • Add WorkTaskConfig.expectedSha256. Windows, macOS, Linux and the web now hash the completed file and compare it with this digest, or with the X-Work-Vault-Sha256 header. A mismatch ends the task as failed with the failure code checksum and is not retried. On Android the value is passed to the existing native verifier through that header. iOS does not check it yet. A malformed digest, or a field and header that disagree, now fails validate.
  • Fix iOS, desktop and web sending the local X-Work-Vault-Sha256 and X-Work-Vault-Md5 headers to the server.
  • Fix desktop and web getTask and getTasks reporting every failure with the generic code failed. The failure's code, message, HTTP status and retryable flag are now stored with the task, so checksum, http_404 and the rest survive a read and an app restart. A row that failed before this version still reads as failed.
  • The task database moves to schema version 2, which adds the failure columns. Older files are upgraded when opened and keep their rows. An older version of the package refuses a version 2 file, so downgrading after the upgrade needs the database to be deleted.
  • Web: hash the download chunk by chunk as it arrives, and keep the received chunks instead of one List<int>. The finished file is no longer copied into one buffer before it is hashed and saved.
  • Update pigeon to 30.0.4 (pinned) and regenerate the Dart, Kotlin, and Swift bindings. The wire format is unchanged. The Kotlin enum lookups now index the cached enum values by raw.
  • Example app: rebuilt as a small download manager on package:material_ui. It restores tasks on launch, offers pause, resume and cancel only when nextTaskStatus allows them, shows progress, failures and completed-file details with an on-demand SHA-256, and adds a new-download form for network, battery and retry options. No plugin API changes.

0.4.1 #

  • Republish of 0.4.0, which was retracted. There are no code changes.

0.4.0 #

  • Breaking (pre-1.0 API trim): package:work_vault/work_vault.dart no longer exports workVaultBackgroundChannel, workVaultBackgroundEntrypoint, workVaultBackgroundLibrary or registerWorkVaultBackgroundHandler. The native hosts carry their own copy of those names, and WorkVault.registerBackgroundHandler is the supported way to register a handler. workVaultBackgroundMain stays exported. To migrate, replace registerWorkVaultBackgroundHandler(handler) with WorkVault.registerBackgroundHandler(handler); the removed constants have no replacement because they only describe the native host contract.
  • Update pigeon to 29.1.0 (pinned) and regenerate the Dart, Kotlin, and Swift bindings. The wire format is unchanged.
  • Enable stricter lints (always_declare_return_types, avoid_dynamic_calls, cancel_subscriptions, directives_ordering, prefer_final_in_for_each, prefer_single_quotes, unnecessary_lambdas) and fix what they reported.
  • Add a tag-triggered release workflow (pub.dev automated publishing), CODE_OF_CONDUCT.md, SUPPORT.md, CODEOWNERS, and a stability and scope section in the README.
  • Document every public member and enforce it with the public_member_api_docs lint.
  • Fix the iOS podspec version, which still said 0.1.0, and add tool/check_versions.dart, which CI runs to keep the pubspec, podspec, changelog and example lockfile versions in agreement.
  • Add homepage and more specific topics to the pub.dev listing.
  • README no longer points users at a src/ import for the background entrypoint.
  • Replace the boilerplate example README and repair the garbled Pigeon instructions in CONTRIBUTING.md.

0.3.2 #

  • Web: Persist TaskStatus.running to the task store on start and resume so getTask immediately reflects the active state.
  • Update pigeon to 29.0.11 and regenerate typed platform IPC bindings for Dart, Kotlin, and Swift.
  • Move browser test suites to test/web/ for consistent CLI and CI test execution.
  • Synchronize example lockfile with root package version.

0.3.1 #

  • Android: Update kotlin-gradle-plugin to 2.4.21. Keep androidx.core:core-ktx on 1.16.0 for Android API 36 compatibility.
  • Fix Chrome web test suite location so flutter test --platform chrome resolves correctly in CI.

0.3.0 #

  • Add macOS support. It uses the desktop engine, which already selected itself on macOS but was never declared or tested. The README documents the com.apple.security.network.client entitlement a sandboxed app needs.
  • Fix WorkVault.enqueue overwriting a newer status. A host that starts work immediately, such as the desktop engine, reports running before enqueue returns its enqueued snapshot, and the vault then showed enqueued while bytes were flowing, so pause was rejected as an illegal transition.
  • Web: resume continues a paused download with Range/If-Range instead of refetching from byte 0, restarts on a changed ETag or 416, and sends WorkTaskConfig.headers (previously ignored on web).
  • Add CI (analyze, format, unit, web, Android, iOS, Pigeon drift), Dependabot, issue and PR templates, SECURITY.md, and CONTRIBUTING.md.
  • Document per-platform guarantees in the README.
  • Format the Dart sources with dart format.
  • The example app builds and runs on macOS, and its end-to-end test uses a unique task id per run, because the desktop task store persists between runs.

0.2.1 #

  • Add screenshots to the pub.dev listing: how it works, the task lifecycle, and a quickstart.

0.2.0 #

  • Add official support for Windows, Linux, and Web.
  • Add DesktopWorkVaultEngine (dartPluginClass) for Windows and Linux with resumable HTTP GET streaming via Range: bytes=X- headers, SHA-256 integrity verification, and SQLite database persistence.
  • Add WebWorkVaultEngine (flutter_web_plugins) for Web with Fetch/Streams API chunk streaming, progress observation, web database persistence, SHA-256 checks, and automatic browser file download triggers.
  • Implement web-safe abstractions and conditional imports across storage and file hashing layers to prevent dart:io compilation errors on Web.
  • Scaffold native runners for Windows, Linux, and Web in the example/ application with dynamic cross-platform destination paths.
  • Fix every Flutter app build failing in the generated plugin registrant: WorkVaultLinux and WorkVaultWindows are now exported from package:work_vault/work_vault.dart, which is where the registrant imports them from. The export is skipped on web.
  • Carry the schema version and close-on-error handling into the IO database implementation introduced for desktop support.
  • Add iOS tests for retry exhaustion, cancel cleanup, battery gating, and the network-constraint mapping. The cellular and expensive-path settings now come from one function that the background session configuration uses.
  • Fix the iOS plugin not compiling: WorkVaultSessionManager.read now rethrows, so a lookup of an unknown task reports task_not_found instead of failing the build.
  • Document how to run the Dart, Android, and iOS test suites.
  • Add Android tests that pin entity-tag restart, redirect limits, cleartext refusal, timeouts, and retryable HTTP statuses.
  • Record a schema version in the shared SQLite file. A file written by 0.1.0 keeps its rows, and a file from a newer version is refused with a StateError instead of being misread.
  • Fix the headless background engine reusing the first database it opened. Each dispatched event is now written to the database its payload names.
  • Remove the Android TUS upload handler. Version 1 runs resumable HTTPS GET only, so native routing and validation now reject every other method, with or without upload protocol headers.
  • Fix Android so an expected digest passed in X-Work-Vault-Sha256 or X-Work-Vault-Md5 is no longer replaced by the server's Digest or Content-MD5 response header. A server digest is used only when none was supplied, including when a stored task is resumed.
  • Document expected-digest verification, including that iOS does not read these headers yet.
  • Lower the Dart SDK constraint to ^3.13.0 so it matches the documented minimum of Dart 3.13 and Flutter 3.47. The previous ^3.13.4 required Flutter 3.47.7.

0.1.0 #

  • Support one transfer: a resumable HTTPS GET. Android runs it in WorkManager. iOS runs it in a background URLSession. Any other method is rejected.
  • Keep the download running after the UI isolate is gone. A headless Flutter engine receives progress and completion and writes the SQLite projection.
  • Treat the native store as the authority for status, byte count, entity tag, and resume position. initialize reloads that state.
  • Decide completed or failed in the native checksum verifier. Dart records verified, mismatch, or missing and does not change that status.
  • Deliver Android status and progress on the platform main thread while the UI engine is attached.

0.0.1 #

  • Add the Pigeon host contract and the typed Dart control plane for background downloads.
  • Deliver background events through a headless Flutter engine when the UI engine is gone, and store task rows, resume tokens, and SHA-256 status in SQLite.
4
likes
160
points
806
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Resumable HTTPS GET downloads for Flutter across Android, iOS, macOS, Windows, Linux, and Web.

Repository (GitHub)
View/report issues
Contributing

Topics

#download #background #resumable #workmanager #http

License

BSD-3-Clause (license)

Dependencies

crypto, flutter, flutter_web_plugins, meta, path, sqlite3, web

More

Packages that depend on work_vault

Packages that implement work_vault