Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Web support #730

Closed
wants to merge 11 commits into from
6 changes: 5 additions & 1 deletion floor/lib/src/sqflite_database_factory.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import 'package:sqflite_common_ffi_web/sqflite_ffi_web.dart';

// infers factory as nullable without explicit type definition
final DatabaseFactory sqfliteDatabaseFactory = () {
if (Platform.isAndroid || Platform.isIOS) {
if (kIsWeb){
return databaseFactoryFfiWeb;
} else if (Platform.isAndroid || Platform.isIOS) {
return databaseFactory;
} else if (Platform.isLinux || Platform.isMacOS || Platform.isWindows) {
sqfliteFfiInit();
Expand Down
Loading