BrowserStorage class abstract
Base API for browser-backed key/value storage.
Constructors
- BrowserStorage()
-
Creates a browser storage wrapper.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → Storage
-
The browser storage object used by this wrapper.
no setter
Methods
-
clear(
) → void - Removes every value from this storage backend.
-
has(
String key) → bool -
Whether
keycurrently exists in storage. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String key) → String? -
Reads a string value by
key. -
readJson(
String key) → Object? -
Reads and decodes a JSON value by
key. -
readMap(
String key) → Map< String, dynamic> -
Reads a JSON object by
key, returning an empty map when absent. -
remove(
String key) → String? -
Removes
keyand returns the previous value when present. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String key, String value) → void -
Writes a string
valuebykey. -
writeJson(
String key, Object? value) → void -
Encodes and writes
valueas JSON bykey.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited