writePath method
void
writePath(
- String? resolverPath,
- String path,
- dynamic value,
- bool encrypted,
)
Implementation
void writePath(
String? resolverPath,
String path,
dynamic value,
bool encrypted,
) async {
resolverPath ??= '';
// If the document was previously not encrypted and now is, then it should be removed
// from the plaintext store and added to the encrypted one and vice-versa.
if (encrypted) {
if (_plaintextStore.hasValue(resolverPath, path)) {
_plaintextStore.shallowDelete(resolverPath, path);
}
_encryptedStore.writePath(resolverPath, path, value);
} else {
if (_encryptedStore.hasValue(resolverPath, path)) {
_encryptedStore.shallowDelete(resolverPath, path);
}
_plaintextStore.writePath(resolverPath, path, value);
}
}