getFieldObjectFromDartObject function
Implementation
DartObject? getFieldObjectFromDartObject(DartObject obj, String fieldName) {
// Traverse the inheritance chain to find the field
DartObject? currentObj = obj;
while (currentObj != null) {
final field = currentObj.getField(fieldName);
if (field != null) {
return field;
}
currentObj = currentObj.getField('(super)');
}
return null;
}