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 mirror = reflect(object).getField(symbol);
  return mirror.reflectee;
}