writeMap method
write and read Map data
Implementation
Future<void> writeMap({required String key, required Map<String, dynamic> 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);
}
}