We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
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
“透明组件” 只是表述的不可见组件,容易引起误解!适当的表述可以是:命中测试失败(hitTest)的组件,如果透明组件hitTest成功,translucent 与 opaque 的特性将无效!比如使用#DecoratedBox# 来包装子组件,设置透明度为0,也是不可见,反例如下,修改此节translucent 测试代码为: Stack( children: [ Listener( child: ConstrainedBox( constraints: BoxConstraints.tight(Size(300.0, 200.0)), child: DecoratedBox( decoration: BoxDecoration( color: Color.fromARGB(255, 255, 1, 1))), ), onPointerDown: (event) => print("down0"), // behavior: HitTestBehavior.opaque, ), Listener( child: ConstrainedBox( constraints: BoxConstraints.tight(Size(200.0, 100.0)), child: DecoratedBox( decoration: BoxDecoration( color: Color.fromARGB(0, 0, 0, 0)), child: Center( child: Text("左上角200*100范围内非文本区域点击"), ), )), onPointerDown: (event) => print("down1"), behavior: HitTestBehavior.translucent //放开此行注释后可以"点透" ) ], ),
The text was updated successfully, but these errors were encountered:
赞同,我也是在这里纠结了很久。
Sorry, something went wrong.
No branches or pull requests
“透明组件” 只是表述的不可见组件,容易引起误解!适当的表述可以是:命中测试失败(hitTest)的组件,如果透明组件hitTest成功,translucent 与 opaque 的特性将无效!比如使用#DecoratedBox# 来包装子组件,设置透明度为0,也是不可见,反例如下,修改此节translucent 测试代码为:
Stack(
children: [
Listener(
child: ConstrainedBox(
constraints: BoxConstraints.tight(Size(300.0, 200.0)),
child: DecoratedBox(
decoration: BoxDecoration(
color: Color.fromARGB(255, 255, 1, 1))),
),
onPointerDown: (event) => print("down0"),
// behavior: HitTestBehavior.opaque,
),
Listener(
child: ConstrainedBox(
constraints:
BoxConstraints.tight(Size(200.0, 100.0)),
child: DecoratedBox(
decoration: BoxDecoration(
color: Color.fromARGB(0, 0, 0, 0)),
child: Center(
child: Text("左上角200*100范围内非文本区域点击"),
),
)),
onPointerDown: (event) => print("down1"),
behavior: HitTestBehavior.translucent //放开此行注释后可以"点透"
)
],
),
The text was updated successfully, but these errors were encountered: