Skip to content
pubscout

stream_chat_persistence

10.7.0, released 11 days ago by getstream.io

Provides offline SQLite persistence for Stream Chat in Flutter.

WASM-ready
$ flutter pub add stream_chat_persistence
Source repository

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.

  • flutter_local_db

    Embedded local database for Flutter with Rust/LMDB backend, Diesel-style queries, and reactive streams.

Works with

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