stash_memory
5.2.0, released 3 years ago by ivoleitao.dev
Memory storage extension for the stash API to store vaults and caches in-memory.
What it does
Provides an in-memory storage backend for the stash caching and vault API. Allows creating stores to hold typed data objects with support for capacities and event listeners.
AI-written summary of version 5.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need fast in-memory caching or vault storage using the stash API
- You want temporary data storage that does not persist across application restarts
Skip it when
- You need data to persist on the device across app restarts
- You are looking for persistent key-value or SQL storage solutions
Strengths
- Fast in-memory performance
- Integrates with the stash ecosystem and event listeners
- Supports generics for typed data vaults and caches
Weaknesses
- Data is lost when the app closes (in-memory only)
- Requires learning the stash API semantics
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:stash/stash_api.dart';
import 'package:stash_memory/stash_memory.dart';
void main() async {
final store = await newMemoryVaultStore();
final vault = await store.vault<String>(name: 'vault');
await vault.put('key1', 'value1');
print(await vault.get('key1'));
}Alternatives
Packages that do the same job and could replace stash_memory.
- simple_secure_storage
Secure key‑value storage for Flutter with platform‑specific backends.
77Compare - flutter_cache_manager
Generic cache manager for saving web files and cache info on device storage.
91Compare - tostore
Local data engine providing key-value, SQL/NoSQL tables, vector embeddings, and hybrid text search.
88Compare - hive_ce_generator
Automatically generates TypeAdapters for Hive to store custom classes.
88Compare
Works with
Packages commonly used together with stash_memory: ones it builds on, ones built on it, and its own family.