String secrets — session tokens, refresh tokens — kept by key in the OS credential store rather than in app storage.
Apple backs each key with a kSecClassGenericPassword Keychain item
scoped to the host's bundle identifier and never synchronised to iCloud;
Android encrypts the value with an AndroidKeyStore AES-GCM key and keeps
the ciphertext in a private preferences file.
final store = XSecureStore.instance;
await store.write('session', token);
final session = await store.read('session');
Commands run in call order, so a read issued after a write observes it. Values are never logged, on either side of the channel.
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supported → bool
-
Whether this platform has a native store. Elsewhere every operation
throws XSecureStoreException with code
unsupported.no setter
Methods
-
delete(
String key) → Future< void> -
Removes
key. Removing a key that holds nothing succeeds. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String key) → Future< String?> -
The value stored under
key, ornullwhen the key holds nothing. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String key, String value) → Future< void> -
Stores
valueunderkey, replacing any value already there.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → XSecureStore
-
The process-wide store. One credential store, one instance.
final