writeJson method
write and read JSON data
Implementation
Future<void> writeJson({required String key, required Map<String, dynamic> jsonMap, bool isEncrypted = true}) async {
final jsonData = json.encode(jsonMap);
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);
}
}