cubepod_storage 0.1.5
cubepod_storage: ^0.1.5 copied to clipboard
Persistent storage integration and local caching for the CubePod ecosystem.
cubepod_storage #
Persistent reactive storage for CubePod. Wraps SharedPreferences (with support for custom backends) and exposes values as StateSignals so your UI stays in sync automatically.
What's inside #
StorageService— read/write key-value pairs with a typed APIPersistedSignal<T>— aStateSignalthat persists its value to disk
Install #
dependencies:
cubepod_storage: ^0.1.1
Usage #
import 'package:cubepod_storage/cubepod_storage.dart';
// A signal that automatically saves to SharedPreferences
final themeMode = PersistedSignal<String>(
key: 'theme_mode',
defaultValue: 'light',
storage: SharedPreferencesStorage(),
);
// Changing it saves to disk instantly
themeMode.value = 'dark';
// Reading it next app launch returns 'dark'
print(themeMode.value); // dark
See cubepod for the full docs.