卡片的颜色底部呈抖动状

时间:2019-01-23 14:10:27

标签: flutter

我正在使用GridView和Cards构建布局。我想在每张卡的底部涂上颜色。我发现了这个问题Fill an area with color in Flutter,并试图为底部做同样的技巧,但是每次SizedBox溢出圆角时。关于如何解决此问题的任何想法?

下面的示例代码显示了该问题。我尝试给卡的底部上色,然后执行此操作,卡的角会丢失,就像从容器溢出一样。

enter image description here enter image description here

Widget build(BuildContext context) {
return Scaffold(
  backgroundColor: Colors.lightBlue,
  appBar: AppBar(
    title: Text(widget.title),
  ),
  body: Column(
    crossAxisAlignment: CrossAxisAlignment.stretch,
    children: <Widget>[
      Card(
        margin: EdgeInsets.all(20),
        elevation: 10,
        child: SizedBox(
          height: 100,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
              Text("line1"),
              Text(
                "line2",
              ),
              Expanded(
                  child: Container(
                /*color: Colors.orange,*/ child: Text("Bottom"),
              )), 
            ],
          ),
        ),
      ),
      Expanded(
        child: Container(),
      )
    ],
  ),      
);

}

1 个答案:

答案 0 :(得分:0)

尝试在dumpdata中使用> ~/project_dump.json,并使用与BoxDecoration(4.0)相同的半径

Container