getField method

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

Implementation

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