Skip to content
pubscout

rx_storage

4.0.0, released 4 weeks ago by hoc081098.dev

Reactive key-value storage powered by RxDart

WASM-ready
$ flutter pub add rx_storage
Source repository

What it does

Provides a reactive key-value storage wrapper for Dart and Flutter using RxDart streams to observe changes. It supports custom storage adapters, encoders, decoders, and in-memory persistence.

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

Use it when

  • You need to observe specific storage keys as streams in a reactive architecture
  • You want an RxDart-powered storage layer in your Dart or Flutter application

Skip it when

  • You need multi-key transactions or complex relational SQL features
  • You prefer standard Futures and do not use RxDart or streams

Strengths

  • Reactive stream support for observing individual keys or all entries
  • Built-in in-memory storage adapter
  • Customizable encoders and decoders for synchronous and asynchronous operations

Weaknesses

  • Queue system excludes multi-key transactions
  • Direct adapter changes or changes through other wrappers are not observed

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Requires Dart SDK >=3.0.0 <4.0.0. Add via pub add rx_storage.

import 'package:rx_storage/rx_storage.dart';

Future<void> main() async {
  final storage = RxStorage<String, void>(InMemoryStorage<String>());
  final subscription = storage
      .observe<String>('name', (raw) => raw as String?)
      .listen((value) => print('Name: $value'));

  try {
    await storage.write<String>('name', 'Ada', (value) => value);
  } finally {
    await subscription.cancel();
    await storage.dispose();
  }
}

Alternatives

Packages that do the same job and could replace rx_storage.

  • shared_preferences

    If you want the standard, official key-value storage solution for simple preferences without RxDart overhead.

  • sqflite

    If you need a relational SQLite database rather than a simple key-value store.

  • flutter_secure_storage

    If you need to store sensitive data securely using platform-specific secure hardware storage.

Works with

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