Skip to content
pubscout

powersync_attachments_helper

0.7.0, released 7 months ago by powersync.com

Helper for syncing file attachments between local and remote storage in PowerSync apps

$ flutter pub add powersync_attachments_helper
Source repository

What it does

It queues uploads, downloads and deletes of files, watches database changes to enqueue work, and integrates with a remote storage adapter.

AI-written summary of version 0.7.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to keep media files in sync with a remote store while using PowerSync
  • You want a simple queue that reacts to database changes

Skip it when

  • You plan to use the upcoming core PowerSync attachments library
  • You need advanced custom storage backends not supported by the helper

Strengths

  • Built for PowerSync, handles queueing and watching DB changes
  • Supports multiple platforms (Android, iOS, Windows, macOS, Linux)
  • Uses standard Flutter plugins like path_provider

Weaknesses

  • Will be replaced by core library, future features limited
  • No support for custom local storage implementations
  • Requires PowerSync 2.x

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
4

Add dependency, import package, implement AbstractRemoteStorageAdapter, initialize queue in main.dart

import 'package:powersync_attachments_helper/powersync_attachments_helper.dart';

class MyQueue extends AbstractAttachmentQueue {
  MyQueue(db, remote) : super(db: db, remoteStorage: remote);
  // implement saveFile, deleteFile, watchIds
}

initializeAttachmentQueue(db) async {
  attachmentQueue = MyQueue(db, remoteStorage);
  await attachmentQueue.init();
}

Works with

Packages commonly used together with powersync_attachments_helper: ones it builds on, ones built on it, and its own family.