【发布时间】:2018-12-09 15:57:12
【问题描述】:
我想得到这个结构:
-----------------------------------------------------------------------------------
item 1 item 2
item 3 item 4
-----------------------------------------------------------------------------------
基本上我需要有一个Table 和2 个columns,每个rows 有2 个column,但这是我得到的效果:
这是我的代码:
new Container(
decoration: new BoxDecoration(color: Colors.grey),
child: new Row(
children: <Widget>[
new Column(
children: <Widget>[
new Container(
decoration: new BoxDecoration(color: Colors.red),
child: new Text("item 1"),
),
new Container(
decoration: new BoxDecoration(color: Colors.amber),
child: new Text("item 3"),
),
],
),
new Column(
children: <Widget>[
new Container(
decoration: new BoxDecoration(color: Colors.green),
child: new Text("item 2"),
),
new Container(
decoration: new BoxDecoration(color: Colors.teal),
child: new Text("item 4"),
)
],
)
],
),
)
我希望每个column 占用width 可用空间的一半。
在Android 上,我会使用weight 属性,就是这样。
【问题讨论】:
标签: flutter flutter-layout tabular flutter-table