You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The native factory (idbFactoryWeb) is only available on the web. I'm assuming you are using flutter. If you want to target Android, while idbFactoryIo could work I would recommend using idb_sqflite.
The recommended implementation is idb_sqflite
based on sqflite for mobile (iOS, MacOS and Android) or desktop and dart VM using sqflite_ffi_common.
Choosing an implementation is mainly finding the best IdbFactory for the platform.
Here is a basic example to target both web and mobile
In pubspec.yaml:
dependencies:
idb_shim: anyidb_sqflite: any
import'package:flutter/foundation.dart';
import'package:flutter/widgets.dart';
import'package:idb_sqflite/idb_sqflite.dart';
lateIdbFactory idbFactory;
/// Initialization example for flutter////// It uses indexed_db on the web and sqflite on other platformsvoidinitIdbFactory() {
WidgetsFlutterBinding.ensureInitialized();
if (kIsWeb) {
idbFactory = idbFactoryWeb;
} else {
idbFactory = idbFactorySqflite;
}
}
I am getting the error as in title. Running this in Android emulator. This is my code:
then calling the
initStore()
in main.dart file. Am using the latest version (2.6.1+7) of the libThe text was updated successfully, but these errors were encountered: