firebase_database_dart_sqlite library

The SQLite offline cache of firebase_database_dart on the Dart VM and in Flutter.

supportDirectory below is a directory of the app; sqlitePersistence lists one per platform.

final FirebaseDatabase database = FirebaseDatabase(
  app,
  persistence: sqlitePersistence('$supportDirectory/firebase_database'),
);

The limits are in the README of the package.

Classes

SqlitePersistence
SQLite files of the offline cache, one per app and database URL, in one directory.

Functions

clearSqlitePersistence(String directory, {required String appName, required Uri databaseUrl}) → Future<void>
Deletes the cache files of databaseUrl of the app named appName in directory: the database file, its side files and its moved-aside copies. Close the FirebaseDatabase first.
sqlitePersistence(String directory, {int? cacheSizeBytes, bool cacheServerData = true}) → DatabasePersistence
An offline cache in SQLite files under directory, for FirebaseDatabase(persistence: ...).

Exceptions / Errors

ClearPersistenceException
SqlitePersistence.clear could not delete some files of the store.