DATE:
AUTHOR:
PowerSync Product Team
Flutter SDK Flutter Packages/Libraries

Improved Attachment Utilities in the Dart / Flutter SDK

DATE:
AUTHOR: PowerSync Product Team

Overview

The PowerSync Dart/Flutter SDK now includes improved attachment utilities under package:powersync_core/attachments/attachments.dart. This new implementation replaces the previous powersync_attachments_helper APIs which lacked some functionality that that we’ve since added to some of our other SDKs.

Because these utilities are now part of the main powersync_core package, they are more maintainable and are better aligned with similar helpers in our other SDKs. This update also introduces several new features:

  • Support for writing your own local storage implementation

  • Support for dynamic nested directories and custom file extensions out of the box

  • Ability to add optional metaData to attachments

  • This library no longer depends on dart:io

Get started

Import and use the new utilities via:

import 'package:powersync_core/attachments/attachments.dart';

The main requirements are setting up a local-only attachments table in which attachments' state is stored, and using an AttachmentQueue instance to manage and sync attachments.

See full usage details in the documentation.

Demo app

An example implementation of these new utilities is available in the supabase-todolist demo app.

Migration note

If you currently use the powersync_attachments_helper package, a fairly simple migration would be to adopt the new utilities with a different table name and drop the legacy package. This means existing attachments are lost, but will be re-downloaded automatically.

Availability

  • These utilities have been introduced in v1.16.0 of the SDK.

  • They are currently in an alpha release — we encourage you to try it them out and share feedback.

  • Going forward, new feature development will occur only in this powersync_core implementation.

  • The powersync_attachments_helper package will be maintained for critical bug fixes only (no new features), and can be considered deprecated.

Feedback and Questions

Need help or have feedback? Join our Discord or open an issue on GitHub - we’re eager to know what we can improve.

Powered by LaunchNotes