I'm trying to list the methods of a class, but neither reflectClass() nor reflectType() return anything useful. Has anyone done this already?
This is my code:
import 'package:mylib/mylib.dart' as mylib;
import 'dart:mirrors' as mirrors;
void main(List<String> arguments) {
var reflectedMyClass = mirrors.reflectType(mylib.MyClass);
// how to list the methods in MyClass here?
}
Ok, mirrors.reflectClass(someClass).declarations.values is the answer. This stuff was not visible in the debugger window where I was stuck, but a null _declarations instead. Going through completions sometimes seems more helpful than the debugger.