LazyBox<E> class Null safety

LazyBoxes don't keep the values in memory like normal boxes. Each time a value is read, it is loaded from the backend.

Inheritance

Constructors

LazyBox()

Properties

hashCode int
The hash code for this object.
read-onlyinherited
isEmpty bool
Returns true if there are no entries in this box.
read-onlyinherited
isNotEmpty bool
Returns true if there is at least one entries in this box.
read-onlyinherited
isOpen bool
Whether this box is currently open.
read-onlyinherited
keys Iterable
All the keys in the box.
read-onlyinherited
lazy bool
Whether this box is lazy or not.
read-onlyinherited
length int
The number of entries in the box.
read-onlyinherited
name String
The name of the box. Names are always lowercase.
read-onlyinherited
path String?
The location of the box in the file system. In the browser, this is null.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

add(E value) Future<int>
Saves the value with an auto-increment key.
inherited
addAll(Iterable<E> values) Future<Iterable<int>>
Saves all the values with auto-increment keys.
inherited
clear() Future<int>
Removes all entries from the box.
inherited
close() Future<void>
Closes the box.
inherited
compact() Future<void>
Induces compaction manually. This is rarely needed. You should consider providing a custom compaction strategy instead.
inherited
containsKey(dynamic key) bool
Checks whether the box contains the key.
inherited
delete(dynamic key) Future<void>
Deletes the given key from the box.
inherited
deleteAll(Iterable keys) Future<void>
Deletes all the given keys from the box.
inherited
deleteAt(int index) Future<void>
Deletes the n-th key from the box.
inherited
deleteFromDisk() Future<void>
Removes the file which contains the box and closes the box.
inherited
flush() Future<void>
Flushes all pending changes of the box to disk.
inherited
get(dynamic key, {E? defaultValue}) Future<E?>
Returns the value associated with the given key. If the key does not exist, null is returned.
getAt(int index) Future<E?>
Returns the value associated with the n-th key.
keyAt(int index) → dynamic
Get the n-th key in the box.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
put(dynamic key, E value) Future<void>
Saves the key - value pair.
inherited
putAll(Map<dynamic, E> entries) Future<void>
Saves all the key - value pairs in the entries map.
inherited
putAt(int index, E value) Future<void>
Associates the value with the n-th key. An exception is raised if the key does not exist.
inherited
toString() String
A string representation of this object.
inherited
watch({dynamic key}) Stream<BoxEvent>
Returns a broadcast stream of change events.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited