indexedDbIfSupported static method

Future<DriftWebStorage> indexedDbIfSupported(
  1. String name, {
  2. bool inWebWorker = false,
})

Uses DriftWebStorage.indexedDb if the current browser supports it. Otherwise, falls back to the local storage based implementation.

Implementation

static Future<DriftWebStorage> indexedDbIfSupported(String name,
    {bool inWebWorker = false}) async {
  return await supportsIndexedDb(inWebWorker: inWebWorker)
      ? DriftWebStorage.indexedDb(name, inWebWorker: inWebWorker)
      : DriftWebStorage(name);
}