-
Notifications
You must be signed in to change notification settings - Fork 122
Inject方法可以用在自己写的方法中么 #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
自己尝试写了一些inject,但是出现了有的时候能够 inject成功,有的时候 inject不成功的情况。 |
Inject is a sophisticated thing and I don't think it's robust enough to use. |
我想咨询下大佬,我自己写了个方法,然后按照文档增加了注解,如何使之生效呢?怎么触发dill的生成? |
@kelciej Hi,我也在官方example 尝试了Inject , 在我的例子里变量并不会 因为//Aspectd Ignore 在hook时被忽略,你是如何成功使用的,能否告诉我一下? |
您好,

请问一下@Inject可以注入到自己写的方法中么?
比方说 注入到 官方 example 的_incrementCounter 中,
比方说想在【91】行写入一个输出
` @Inject("package:example/lib/main.dart","_MyHomePageState","-_incrementCounter",lineNum:91)
@pragma("vm:entry-point")
static void counterHook() {
int count;//Aspectd Ignore
int _counter;//Aspectd Ignore
print("[KWLM12]:count:$count,counter:$_counter");
//【91】行 }`
但是无法注入

生成文件app.aspectd.dill.txt显示 如下图,
The text was updated successfully, but these errors were encountered: