1

我不确定我是否说得通,但本质上,我想在一个带有裁剪器 ( 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。请帮忙,谢谢!

4

0 回答 0