getFieldsElementsMap method
Implementation
Map<String, UIElement> getFieldsElementsMap(
{List<String>? fields, List<String>? ignoreFields}) {
ignoreFields ??= [];
var specificFields = isNotEmptyObject(fields);
var fieldsElements = getFieldsElements();
var map = <String, UIElement>{};
for (var elem in fieldsElements) {
var fieldName = getElementFieldName(elem)!;
var include = specificFields ? fields!.contains(fieldName) : true;
if (include && !ignoreFields.contains(fieldName)) {
if (map.containsKey(fieldName)) {
var elemValue =
parseChildElementValue(map[fieldName], allowTextAsValue: false);
if (isEmptyObject(elemValue)) {
var value = parseChildElementValue(elem, allowTextAsValue: false);
if (isNotEmptyObject(value)) {
map[fieldName] = elem;
}
}
} else {
map[fieldName] = elem;
}
}
}
return map;
}