stream_chat_persistence
10.7.0, released 11 days ago by getstream.io
Provides offline SQLite persistence for Stream Chat in Flutter.
What it does
Stores chat data locally using Drift (SQLite) and syncs it with the Stream Chat backend. Enables offline access, optimistic UI updates, and faster reads by caching messages, members, reactions, and more.
AI-written summary of version 10.7.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need offline chat support with caching and sync for Stream Chat apps
- You want faster local reads and optimistic UI updates
- Your app targets multiple platforms including web, requiring a unified storage solution
Skip it when
- Your app doesn't use Stream Chat or needs a generic storage solution
- You prefer a NoSQL or key‑value store over SQLite
- You want a zero‑dependency solution for tiny apps
Strengths
- Full offline cache for all chat entities
- Built on Drift with indices for performance
- Works across mobile, desktop, and web (with sql.js)
Weaknesses
- Adds SQLite dependency and native setup
- Web requires manual inclusion of sql-wasm files
- Only useful with Stream Chat, not a general storage library
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 7
Add the package to pubspec, run flutter pub get, and for web include sql-wasm.js and sql-wasm.wasm in the web folder
final chatPersistentClient = StreamChatPersistenceClient(logLevel: Level.INFO, connectionMode: ConnectionMode.regular);
final client = StreamChatClient(apiKey, logLevel: Level.INFO)..chatPersistenceClient = chatPersistentClient;Alternatives
Packages that do the same job and could replace stream_chat_persistence.
- once
Run code or show widgets once, daily, weekly, monthly, or on new app versions.
77Compare - flutter_local_db
Embedded local database for Flutter with Rust/LMDB backend, Diesel-style queries, and reactive streams.
65Compare
Works with
Packages commonly used together with stream_chat_persistence: ones it builds on, ones built on it, and its own family.
- loggingstream_chat_persistence depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- path_providerstream_chat_persistence depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- driftstream_chat_persistence depends on itDrift is a reactive library to store relational data in Dart and Flutter applications.
- sqlite3_flutter_libsstream_chat_persistence depends on itObsolete package that once bundled native SQLite libraries for Flutter; now contains no code.
- stream_chatstream_chat_persistence depends on itLow‑level Dart client for Stream Chat API
- stream_chat_flutter_coreSame familyCore Flutter SDK for Stream Chat providing business logic and controllers without UI.
- stream_chat_flutterSame familyFull-featured Flutter UI SDK for Stream Chat, providing ready‑made chat widgets and theming.
- stream_thumbnailSame familyCreate thumbnail images from local video files or URLs as bytes or files.