How can I get the Type from a DeclerationMirror in Dart

38 Views Asked by At

I am iterating over my libraries declarations using mirrors so I can read the meta data on my classes. But I need to get the actual type of the declaration I'm currently on, but I don't see a way to do this in the api docs.

var decs = myLibraryMirror.declarations;
decs.forEach((symbol, dec){
  dec.metaData.forEach((metaMirror){
    var meta = metaMirror.reflectee;
    if(meta is TheTypeImInterestedIn){
      // do some stuff with the meta object and the class Type it's declared on
      // but how to get the Type of the class that the declaration refers too?
    }
  });
});
0

There are 0 best solutions below