fluffychat/lib/utils/database/web.dart
2021-06-18 10:29:48 +02:00

18 lines
502 B
Dart

import 'package:matrix/matrix.dart';
import 'package:moor/moor_web.dart';
import 'dart:html';
Future<Database> constructDb(
{bool logStatements = false,
String filename = 'database.sqlite',
String password = ''}) async {
Logs().v('[Moor] Using moor web');
return Database(WebDatabase.withStorage(
await MoorWebStorage.indexedDbIfSupported(filename),
logStatements: logStatements));
}
Future<String> getLocalstorage(String key) async {
return window.localStorage[key];
}