writeString method
write and read String data
Implementation
Future<void> writeString({required String key, required String value, bool isEncrypted = true}) async {
final jsonData = json.encode(value);
if (isEncrypted) {
final encryptedData = _encrypter.encrypt(jsonData, iv: _iv).base64;
await _secureStorage.write(key: key, value: encryptedData);
} else {
await _secureStorage.write(key: key, value: jsonData);
}
}