0

在此处输入图像描述

现在我正在尝试绘制一个带有半径边框的容器以与另一个容器相交但是有一条线在每个容器周围仍然可见,如图所示有谁知道如何隐藏它!

有我的代码

Container(
              height: MediaQuery.of(context).size.height * .47,
              width: MediaQuery.of(context).size.width,
              decoration: BoxDecoration(
                color: Color.fromRGBO(28, 163, 200, 1),
                border: null,
                borderRadius: BorderRadius.only(
                  bottomLeft: Radius.circular(30.0),
                  //bottomLeft: Radius.circular(40.0),
                ),
              ),
            ),
            Container(
              color: Colors.transparent,
              child: Container(
                width: MediaQuery.of(context).size.width,
                color: Color.fromRGBO(28, 163, 200, 1),
                child: Container(
                  width: MediaQuery.of(context).size.width,
                  decoration: BoxDecoration(
                    color: Color.fromRGBO(247, 250, 251, 1),
                    border: null,
                    borderRadius: BorderRadius.only(
                      topRight: Radius.circular(30.0),
                      //bottomLeft: Radius.circular(40.0),
                    ),
                  ),
                  child: Padding(
                    padding: const EdgeInsets.only(left: 20, right: 20, top: 20),
                    child: Row(
                      mainAxisSize: MainAxisSize.min,
                      children: [
                        Text(
                          "القائمة",
                          style: TextStyle(
                              fontWeight: FontWeight.bold,
                              fontSize: 18,
                              color: Colors.black),
                        ),
                        Spacer(),
                        Text(
                          "عرض الكل",
                          style: TextStyle(
                              fontSize: 14,
                              color: Color.fromRGBO(255, 140, 0, 1)),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
            ),
4

2 回答 2

1

听起来像是渲染器工件,如果您更改顶部容器高度比,它就会消失

 height: MediaQuery.of(context).size.height * .47, // <-- change this to be 0.5 

如果你真的想要那个特定的高度,那么使用Stack()而不是嵌入式容器

于 2021-04-28T23:16:33.007 回答
0

如果您更改容器的高度,它将正确呈现。我附上了我得到的结果的截图:

Column(
        children: [
          Container(
            height: 300, //<--- This is what's causing the issue
            width: MediaQuery.of(context).size.width,
            decoration: BoxDecoration(
              color: Color.fromRGBO(28, 163, 200, 1),
              borderRadius: BorderRadius.only(
                bottomLeft: Radius.circular(30.0),
                //bottomLeft: Radius.circular(40.0),
              ),
            ),
          ),
          Container(
            // color: Colors.transparent,
            child: Container(
              width: MediaQuery.of(context).size.width,
              decoration: BoxDecoration(
                color: Color.fromRGBO(28, 163, 200, 1),
              ),
              child: Container(
                width: MediaQuery.of(context).size.width,
                decoration: BoxDecoration(
                  color: Color.fromRGBO(247, 250, 251, 1),
                  borderRadius: BorderRadius.only(
                    topRight: Radius.circular(30.0),
                    //bottomLeft: Radius.circular(40.0),
                  ),
                ),
                child: Padding(
                  padding: const EdgeInsets.only(left: 20, right: 20, top: 20),
                  child: Row(
                    children: [
                      Text(
                        "القائمة",
                        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.black),
                      ),
                      Spacer(),
                      Text(
                        "عرض الكل",
                        style: TextStyle(fontSize: 14, color: Color.fromRGBO(255, 140, 0, 1)),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ),
        ],
      )

在此处输入图像描述

于 2021-04-29T01:10:03.483 回答