updateNodeValue method

Future<bool> updateNodeValue(
  1. String nodePath,
  2. String key,
  3. String value
)

Update a node value

Implementation

Future<bool> updateNodeValue(
    String nodePath, String key, String value) async {
  try {
    Node node = await storageController!.get(nodePath);
    node.addOrUpdateValue(
      NodeValueImpl(key, value),
    );
    await storageController!.addOrUpdate(node);
    log('Updated node: ');
    log(node.toString());
    return true;
  } catch (e, trace) {
    log('Failed to update node $nodePath');
    log(e.toString());
    if (exceptionHandler != null) {
      exceptionHandler!(e, trace);
    }
    return false;
  }
}