saveString method

  1. @override
Future<void> saveString(
  1. String string, {
  2. required RCacheKey key,
})
override

Method for storing a String with a defined key.

Example:

// RCache.credentials.saveString("data string", key: RCacheKey("string"));

Implementation

@override
Future<void> saveString(String string, {required RCacheKey key}) async {
  try {
    return await methodChannel.invokeMethod(
      RCacheMethod.key.save.string,
      rArgs(type: RCacheMethod.key.credentials, key: key, value: string),
    );
  } on PlatformException catch (e) {
    return Future.error(e);
  }
}