LocalStorage class IO
A utility class for persistent key-value storage.
Delegates to StorageBackend for platform-specific persistence
(browser localStorage on web, JSON file on SDL3).
Values must be JSON-serializable.
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
clear(
) → void - Removes all stored keys.
-
delete(
String key) → void -
Deletes a value from storage for the given
key. -
getAllKeys(
) → List< String> - Returns a list of all stored keys.
-
load<
T> (String key, [T? defaultValue]) → T? -
Loads a value of type
Tfrom storage. -
save<
T> (String key, T value) → void -
Saves a value to storage with the given
key.