getField function

DartObject? getField(
  1. DartObject? object,
  2. String field
)

Recursively gets the field from the DartObject.

If the field is not found in the object, then it will visit the super object.

Implementation

DartObject? getField(DartObject? object, String field) {
  if (isNull(object)) return null;
  var fieldValue = object!.getField(field);
  if (!isNull(fieldValue)) {
    return fieldValue;
  }
  return getField(object.getField('(super)'), field);
}