Skip to content
pubscout

crdt

5.1.3, released 2 years ago by cachapa.net

Dart implementation of Conflict-free Replicated Data Types (CRDTs).

WASM-ready
$ flutter pub add crdt
Source repository

What it does

Provides a storage‑agnostic CRDT framework with Hybrid Logical Clocks for conflict resolution. It includes an in‑memory MapCrdt and hooks for custom storage backends.

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

Use it when

  • building local‑first apps that need offline sync
  • implementing collaborative editing features
  • creating deterministic data stores for distributed systems

Skip it when

  • needing ready‑made UI widgets or a full state‑management solution

Strengths

  • Zero external dependencies, runs on any Dart platform
  • Storage‑agnostic API allows swapping persistence layers
  • Built‑in HLC for consistent ordering across nodes

Weaknesses

  • No built‑in persistence or UI components
  • Requires manual integration with storage backends
  • Limited documentation on advanced use cases

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:crdt/map_crdt.dart';

void main() {
  var crdt1 = MapCrdt(['table']);
  crdt1.put('table', 'a', 1);
  crdt1.put('table', 'b', 1);
  print(crdt1.getMap('table'));
}

Alternatives

Packages that do the same job and could replace crdt.

  • csv_plus

    Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.

  • geotypes

    Lightweight library providing GeoJSON data types for Dart and Flutter

  • result_type

    A Result type representing success or failure in Dart

  • conduit_codable

    A library for encoding and decoding dynamic structured data like JSON and YAML into Dart objects.

Works with

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