ftd icon indicating copy to clipboard operation
ftd copied to clipboard

FunctionLog 使用场景

Open GvcZhang opened this issue 4 years ago • 3 comments

大佬,如何使得 FunctionLog 可以使用在如下这样的场景中呢?

TextButton(onPressed: (){
  print("2222222222");
}, child: Text("Text Button"))

例如上面代码中的 onPressed 添加 FunctionLog 功能

GvcZhang avatar May 08 '21 03:05 GvcZhang

TextButton(onPressed: () => onBtnPress(), child: Text("Text Button"))

@FunctionLog()
void onBtnPress() {
// do something
}

这样不行吗

franticn avatar May 10 '21 09:05 franticn

TextButton(onPressed: () => onBtnPress(), child: Text("Text Button"))

@FunctionLog()
void onBtnPress() {
// do something
}

这样不行吗

可以,但是这个需要定义一个方法。

GvcZhang avatar May 10 '21 09:05 GvcZhang

注解要修饰方法作为标识,否则无法过滤。 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.

fightcoder avatar May 11 '21 14:05 fightcoder