drift/examples/flutter_web_worker_example/web/worker.dart

15 lines
374 B
Dart
Raw Normal View History

2021-10-27 12:25:32 -07:00
// ignore: avoid_web_libraries_in_flutter
import 'dart:html';
import 'package:drift/web.dart';
import 'package:drift/web/worker.dart';
2021-10-27 12:25:32 -07:00
void main() {
WorkerGlobalScope.instance.importScripts('sql-wasm.js');
2021-10-27 12:25:32 -07:00
driftWorkerMain(() {
return WebDatabase.withStorage(DriftWebStorage.indexedDb('worker',
migrateFromLocalStorage: false, inWebWorker: true));
2021-10-27 12:25:32 -07:00
});
}