decode static method
Implementation
static List<TransformationData> decode(String encodedString) {
var transformations = <TransformationData>[];
var transformationStrings = encodedString.split("~");
for (var transformationString in transformationStrings) {
var mainComponents = transformationString.split(RegExp(r"\("));
if (mainComponents.length != 2) continue;
var pluginAndName = mainComponents[0].split(".");
if (pluginAndName.length != 2) continue;
var plugin = pluginAndName[0];
var name = pluginAndName[1];
var values = <String, dynamic>{};
var parametersPart =
mainComponents[1].substring(0, mainComponents[1].length - 1);
var parameterPairs = parametersPart.split(",");
for (var pair in parameterPairs) {
var keyValue = pair.split(":");
if (keyValue.length == 2) {
values[keyValue[0]] = keyValue[1];
}
}
transformations
.add(TransformationData(plugin: plugin, name: name, values: values));
}
return transformations;
}