Merge branch 'krille/update-readme' into 'main'

chore: Update readme with new database

Closes #329

See merge request famedly/company/frontend/famedlysdk!1181
This commit is contained in:
Mohammad Reza Moradi 2022-11-24 13:09:50 +00:00
commit df0981cadc
1 changed files with 3 additions and 3 deletions

View File

@ -36,9 +36,9 @@ The SDK works better with a database. Otherwise it has no persistence. For this
```dart
final client = Client(
"HappyChat",
databaseBuilder: (Client client) async {
await Hive.init('/path/to/your/storage');
final db = FamedlySdkHiveDatabase(client.clientName);
databaseBuilder: (_) async {
final dir = await getApplicationSupportDirectory(); // Recommend path_provider package
final db = HiveCollectionsDatabase('matrix_example_chat', dir.path);
await db.open();
return db;
},