editTag method
Implementation
Future<void> editTag(String key, String newValue) async {
try {
final ProductTag editedProductTag = ProductTag(
barcode: barcode,
key: key,
value: newValue,
owner: '',
version: _getCurrentTagVersion(key) + 1,
editor: '',
lastEdit: DateTime.now(),
comment: '',
);
await _addOperation(
barcode,
FolksonomyOperation(type: FolksonomyAction.edit, tag: editedProductTag),
);
unawaited(_refreshDisplayableTags());
} catch (e) {
value = FolksonomyStateError(
error: e,
action: FolksonomyAction.edit,
tags: _tags,
);
}
}