Skip to content

Commit

Permalink
Merge pull request #1816 from famedly/krille/update-example
Browse files Browse the repository at this point in the history
docs: Update example with matrixsdkdatabase
  • Loading branch information
krille-chan authored May 27, 2024
2 parents 265f889 + ea98ca4 commit 1f597a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:matrix/matrix.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
import 'package:sqflite/sqflite.dart' as sqlite;

void main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -10,7 +11,10 @@ void main() async {
'Matrix Example Chat',
databaseBuilder: (_) async {
final dir = await getApplicationSupportDirectory();
final db = HiveCollectionsDatabase('matrix_example_chat', dir.path);
final db = MatrixSdkDatabase(
c.name,
await sqlite.openDatabase(dir.toString() + '/database.sqlite'),
);
await db.open();
return db;
},
Expand Down

0 comments on commit 1f597a7

Please sign in to comment.