FurryChat/lib/utils/database/web.dart
2020-10-15 16:51:24 +03:00

20 lines
553 B
Dart

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