我不确定我是否说得通,但本质上,我想在一个带有裁剪器 ( ClipPath()
) 的容器内有一个全尺寸的图像。图像需要溢出两个剪辑器。这是我试图实现的目标:
不幸的是,当我收到此错误消息时,我的方法不起作用:
断言失败:..\...\widgets\basic.dart:920
clipBehavior != Clip.none
不是真的
这是我的代码
Stack(
children: [
Positioned(
bottom: size.height * .2,
right: size.width * .1,
child: ClipPath(
clipBehavior: Clip.none,
clipper: ContactFullTriangleClipper(),
child: Container(
color: Colors.teal,
width: size.width * .3,
height: size.height * .4,
child: Stack(
clipBehavior: Clip.none,
children: [
Positioned(
bottom: 0,
child: Image.asset('/images/me/bottom.png',
height: size.height * .5,
fit: BoxFit.fitHeight),
),
],
),
),
),
),
],
),
当Stack
' 和ClipPaths
' 的clipBehavior
属性都设置为时会出现错误Clip.none
。请帮忙,谢谢!