You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
分析处理后的dill文件
return new ges::GestureDetector::•(
key: this.namedParams. as key::Key*,
child: this.namedParams. as fra::Widget*,
onTap: this.namedParams. as () →* void,
...
excludeFromSemantics: this.namedParams. as core::bool*,
dragStartBehavior: this.namedParams. as rec::DragStartBehavior*,
$creationLocationd_0dea112b090073317d4: this.namedParams. as wid::_Location*);
Hook的代码:
@call("package:flutter/src/widgets/gesture_detector.dart", "GestureDetector",
"+GestureDetector")
@pragma("vm:entry-point")
static dynamic GestureDetector(PointCut pointcut) {
print('[KWLM-ljg]: Hook GestureDetector Constructor!');
return pointcut.proceed();
}
系统GestureDetector的构造函数:
GestureDetector({
Key key,
this.child,
this.onTap,
...
this.excludeFromSemantics = false,
this.dragStartBehavior = DragStartBehavior.start,
}) : assert(excludeFromSemantics != null),
assert(dragStartBehavior != null),
assert(() {
...
}
分析处理后的dill文件
return new ges::GestureDetector::•(
key: this.namedParams. as key::Key*,
child: this.namedParams. as fra::Widget*,
onTap: this.namedParams. as () →* void,
...
excludeFromSemantics: this.namedParams. as core::bool*,
dragStartBehavior: this.namedParams. as rec::DragStartBehavior*,
$creationLocationd_0dea112b090073317d4: this.namedParams. as wid::_Location*);
excludeFromSemantics和dragStartBehavior赋值为null。
测试debug环境是有问题的,release是正常的,因为release会删除assert。
在debug手动配置默认值后也是正常的,代码如下:
static dynamic GestureDetector(PointCut pointcut) {
print('[KWLM-ljg]: Hook GestureDetector Constructor!');
pointcut.namedParams['excludeFromSemantics'] = false;
pointcut.namedParams['dragStartBehavior'] = DragStartBehavior.start;
return pointcut.proceed();
}
希望能优化该问题。
The text was updated successfully, but these errors were encountered: