问题描述
现在我正在尝试绘制一个带有半径边框的容器以与另一个容器相交 但是如图所示,每个容器周围都有一条线保持可见,有没有人知道如何隐藏它!
这是我的代码
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,child: Container(
width: MediaQuery.of(context).size.width,decoration: Boxdecoration(
color: Color.fromrGBO(247,250,251,borderRadius: BorderRadius.only(
topRight: Radius.circular(30.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,1)),],
解决方法
听起来像一个渲染器神器,如果你改变顶部容器的高度比例,它就会消失
height: MediaQuery.of(context).size.height * .47,// <-- change this to be 0.5
如果你真的想要那个特定的高度,那么使用 Stack()
而不是嵌入式容器
如果您更改容器的高度,它将正确呈现。我附上了我得到的结果的截图:
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,child: Container(
width: MediaQuery.of(context).size.width,decoration: BoxDecoration(
color: Color.fromRGBO(247,250,251,borderRadius: BorderRadius.only(
topRight: Radius.circular(30.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,1)),],)