getAttribute function

Object? getAttribute(
  1. String field,
  2. Object? object
)

Reflection based object attribute getter.

Implementation

Object? getAttribute(String field, Object? object) {
  var symbol = MirrorSystem.getSymbol(field);
  var fieldMirror = reflect(object).getField(symbol);
  return fieldMirror.reflectee;
}