process method
Implementation
String process(String documentContent) {
var myString = documentContent;
var p = param(myString);
while (p != null) {
if (p is KeyValue) {
var k = p;
if (k.key == paramScreenWidthByFactor) {
var size = fullScreenWidth(context) * k.doubleValue(1);
myString = k.replaceParamInStringWithDouble(myString, size);
} else if (k.key == paramScreenHeightByFactor) {
var size = fullScreenHeight(context) * k.doubleValue(1);
myString = k.replaceParamInStringWithDouble(myString, size);
} else {
myString = otherKeyValue(myString, k);
}
} else if (p is SingleValue) {
if (p.value() == paramUserName) {
var usr = userName() ??
'?'
'';
myString = p.replaceParamInStringWithString(myString, usr);
} else if (p.value() == paramUserGroup) {
var usr = userGroup();
myString = p.replaceParamInStringWithString(myString, usr);
} else {
myString = otherSingleValue(myString, p);
}
} else {
myString = otherParam(myString, p);
}
p = param(myString);
}
return myString;
}