SessionStorage class
Browser sessionStorage wrapper for tab-scoped key/value data.
- Inheritance
-
- Object
- BrowserStorage
- SessionStorage
Constructors
- SessionStorage()
-
Creates a
sessionStoragewrapper.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
sessionStorageobject.no setteroverride
Methods
-
clear(
) → void -
Removes every value from this storage backend.
inherited
-
has(
String key) → bool -
Whether
keycurrently exists in storage.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String key) → String? -
Reads a string value by
key.inherited -
readJson(
String key) → Object? -
Reads and decodes a JSON value by
key.inherited -
readMap(
String key) → Map< String, dynamic> -
Reads a JSON object by
key, returning an empty map when absent.inherited -
remove(
String key) → String? -
Removes
keyand returns the previous value when present.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String key, String value) → void -
Writes a string
valuebykey.inherited -
writeJson(
String key, Object? value) → void -
Encodes and writes
valueas JSON bykey.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited