put method

  1. @override
Future<void> put(
  1. CalljmpStoreKey key,
  2. String value
)
override

Stores a value in secure storage and updates the cache.

This method calls the native platform implementation to securely store the value and then updates the in-memory cache.

key The storage key to store the value under. value The value to store securely.

Returns a Future that completes when the value is stored.

Example

await store.put(
  CalljmpStoreKey.accessToken,
  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
);

Implementation

@override
Future<void> put(CalljmpStoreKey key, String value) async {
  await methodChannel.invokeMethod("securePut", {
    "key": key.name,
    "value": value,
  });
  _cache[key] = value;
}