HiveLocalDatabase class
A LocalDatabase implementation that uses Hive
as the underlying storage.
This is used to store data via actions for the SDK.
- Inheritance
-
- Object
- ChangeNotifier
- LocalDatabase
- HiveLocalDatabase
Constructors
- HiveLocalDatabase(Box _box, {required String identifier})
-
Creates a HiveLocalDatabase with the given
box
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- identifier → String
-
The identifier for the storage. This is used to identify the storage
from its project id.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → Future< void> -
Clears all the data in the storage.
override
-
containsKey(
String key) → bool -
Whether or not the storage contains the given
key
.override -
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
get(
String key, {Object? defaultValue}) → Object? -
Returns the value stored in the storage with the given
key
. If the key is not found or has a null value, then thedefaultValue
is returned.override -
getAll(
) → Map< String, dynamic> -
Returns all the data in the storage as a map.
override
-
getNotifier(
String? key) → Listenable -
Returns a
_StorageListenable
that notifies when the value for the givenkey
in the storage changes. These listeners are automatically disposed when the storage is closed usingclose
method.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
put(
String key, Object? value) → Future< void> -
Stores the given
value
in the storage with the givenkey
.override -
remove(
String key) → Future< void> -
Removes the value stored in the storage with the given
key
.override -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited