getField method

Map<String, dynamic> getField({
  1. String name = "",
  2. List? attributes,
})

Implementation

Map<String,dynamic> getField({String name="",List? attributes}){
    Map<String,dynamic> result = {};
    if(fields.containsKey(name)){
        result=fields[name]!;
    }
    else{
        if(attributes!.length>0){
            fields.forEach((name,field) {
                if(result.isNotEmpty) {
                    List attributes = getFieldAttributes(name);
                    attributes.forEach((attribute) {
                        if (attributes.contains(attribute)) {
                            result = field;
                        }
                    });

                }
            });
        }
    }
    return result;
}