【发布时间】:2017-10-18 14:22:39
【问题描述】:
我正在尝试在卡片小部件中的某些文本和图标的顶部和底部添加一些填充。我发现颤振有一种简单的方法可以为容器执行此操作,但似乎无法找到使用其他小部件执行此操作的方法(除了将它们包装在容器中)。这是我目前得到的代码:
body: new Container(
padding: new EdgeInsets.all(10.0),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget> [
new Card(
color: Colors.white70,
child: new Container(
padding: new EdgeInsets.all(10.0),
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget> [ //Padding between these please
new Text("I love Flutter", style: new TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
new Icon(Icons.favorite, color: Colors.redAccent, size: 50.0)
]
)
)
)
]
)
)
因此,在我的子列中,我想在顶部和底部添加一些填充,而不必插入新的容器。这可能吗?
【问题讨论】: