ftd
ftd copied to clipboard
FunctionLog 使用场景
大佬,如何使得 FunctionLog 可以使用在如下这样的场景中呢?
TextButton(onPressed: (){
print("2222222222");
}, child: Text("Text Button"))
例如上面代码中的 onPressed 添加 FunctionLog 功能
TextButton(onPressed: () => onBtnPress(), child: Text("Text Button"))
@FunctionLog()
void onBtnPress() {
// do something
}
这样不行吗
TextButton(onPressed: () => onBtnPress(), child: Text("Text Button")) @FunctionLog() void onBtnPress() { // do something }这样不行吗
可以,但是这个需要定义一个方法。
注解要修饰方法作为标识,否则无法过滤。 457155134 @.*** 签名由 网易邮箱大师 定制 在2021年05月10日 17:32,GvcZhang 写道: TextButton(onPressed: () => onBtnPress(), child: Text("Text Button"))
@FunctionLog()
void onBtnPress() {
// do something
} 这样不行吗 可以,但是这个需要定义一个方法。 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.