shared_map
1.1.9, released 2 years ago by an unverified publisher
A synchronized Map for sharing key‑value data across Dart isolates and processes
What it does
Provides a thread‑safe, shared map implementation that can be accessed from multiple isolates or external apps. It exposes async getters, setters, and callbacks for initialization and absence handling.
AI-written summary of version 1.1.9, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to share mutable state between isolates or separate Dart processes
- You want a lightweight, dependency‑free shared data store without a full state‑management framework
Skip it when
- You only need simple in‑memory maps within a single isolate
- You require advanced state‑management features like reactive widgets or dependency injection
Strengths
- Zero dependencies, pure Dart
- Supports async operations and callbacks
- Designed for isolate communication and scalability
Weaknesses
- No built‑in UI integration
- Limited to Map semantics, no advanced querying
- Requires manual handling of shared references
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add dependency in pubspec, import package, create SharedStore and obtain SharedMap via async factory methods
import 'dart:isolate';
import 'package:shared_map/shared_map.dart';
void main() async {
var store = SharedStore('app');
var map = await store.getSharedMap<String,int>('counter');
await map.put('count', 1);
var val = await map.get('count');
print(val); // 1
}
Alternatives
Packages that do the same job and could replace shared_map.
- isolate_channel
Communication channels for isolates based on Flutter's platform channels.
82Compare - sec
Standards for Efficient Cryptography implementation including SECP256K1 and SECP256R1.
46Compare
Works with
Packages commonly used together with shared_map: ones it builds on, ones built on it, and its own family.