DriftWebStorage class abstract
Interface to control how drift should store data on the web.
Constructors
- DriftWebStorage(String name)
-
Creates the default storage implementation that uses the local storage
apis.
constfactory
- DriftWebStorage.indexedDb(String name, {bool migrateFromLocalStorage, bool inWebWorker})
-
An experimental storage implementation that uses IndexedDB.
factory
- DriftWebStorage.volatile()
-
Creates an in-memory storage that doesn't persist data.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> - Closes the storage implementation.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
) → Future< void> - Opens the storage implementation.
-
restore(
) → Future< Uint8List?> - Restore the last database version that was saved with store.
-
store(
Uint8List data) → Future< void> - Store the entire database.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
indexedDbIfSupported(
String name, {bool inWebWorker = false}) → Future< DriftWebStorage> - Uses DriftWebStorage.indexedDb if the current browser supports it. Otherwise, falls back to the local storage based implementation.
-
supportsIndexedDb(
{bool inWebWorker = false}) → Future< bool> - Attempts to check whether the current browser supports the DriftWebStorage.indexedDb storage implementation.