Provides app-local storage of key-value pairs.
The values written to this storage are persisted across app reloads for the lifetime of the app on the end user's device. Unlike NativeSecureStorage, which may persist values after an app is uninstalled, values written to this storage are guaranteed to be removed when the app is no longer present on the device.
- Implemented types
Constructors
- NativeLocalStorage.new({String? namespace, String? scope})
-
Provides app-local storage of key-value pairs.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isolated → IsolatedNativeStorage
-
A NativeStorage that performs storage operations asynchronously on a
separate isolate.
no setterinherited
- namespace → String
-
The main identifier all values are stored under.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scope → String?
-
An optional tag for separating values for different parts of your app.
no setterinherited
- secure → NativeSecureStorage
-
Provides platform-specific secure storage, typically using the OS's secure
keychain or keystore.
no setterinherited
Methods
-
clear(
) → void -
Clears all values synchronously for the configured
namespace
andscope
from storage.inherited -
close(
) → void -
Frees up any resources associated with this storage instance.
inherited
-
delete(
String key) → String? -
Deletes a value synchronously from storage.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String key) → String? -
Reads a value synchronously from storage.
inherited
-
scoped(
String scope) → NativeLocalStorage -
Creates a new NativeStorage instance with the same configuration as
this instance, but with the provided
scope
.override -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String key, String value) → String -
Writes a value synchronously to storage.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited