我正在使用缺少文档的pub库。一种方法返回Future值。如何在不深入了解源代码的情况下揭示其可用的属性和方法?
undocumentedMethod().then((unknown){
print(unknown); //How do I use this?
});
答案 0 :(得分:3)
import 'dart:mirrors';
undocumentedMethod().then((unknown){
var r = reflect(unknown).type; // ClassMirror
var m = r.declarations;
window.console.log(m);
});