updateMultilingualValues method

Future<void> updateMultilingualValues(
  1. Node node,
  2. String key,
  3. List<MultilingualValues> description
)

Implementation

Future<void> updateMultilingualValues(
    Node node, String key, List<MultilingualValues> description) async {
  NodeValue? nv = await node.getValue(key);
  if (nv == null) {
    log('Failed to get the node value with $key');
  } else {
    for (int i = 0; i < description.length; i++) {
      nv.setValue(
        description[i].value,
        Locale.parse(description[i].language),
      );
    }
    node.addOrUpdateValue(nv);
  }
}