/** * 表格 * 表格的每一行的高度,由其内容决定,每一列的宽度,则由columnWidths控制 Table({ Key key, this.children = const <TableRow>[],// this.columnWidths,//设置每一列的宽度。 this.defaultColumnWidth = const FlexColumnWidth(1.0),//默认的每一列宽度值,默认情况下均分 this.textDirection,//文字方向,一般无需考虑。 this.border,//表格边框。 this.defaultVerticalAlignment = TableCellVerticalAlignment.top,//每一个cell的垂直方向的alignment。 top:被放置在的顶部; middle:垂直居中; bottom:放置在底部; baseline:文本baseline对齐; fill:充满整个cell。 this.textBaseline,//defaultVerticalAlignment为baseline的时候,会用到这个属性。 }) */
Table(
columnWidths: <int, TableColumnWidth>{
0: FixedColumnWidth(Screen.width(300)),
1: FixedColumnWidth(Screen.width(300))
},
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
border: TableBorder.all(
color: Colors.grey,
width: Screen.width(2)
),
children: [
TableRow(
decoration: BoxDecoration(
color: ColorGather.colorBg()
),
children: [
Container(
alignment: Alignment.center,
height: Screen.width(80),
child: Text('荣誉等级', style: TextStyle(fontSize: Screen.width(28)),),
),
Text('荣誉等级', style: TextStyle(fontSize: Screen.width(28)), textAlign: TextAlign.center,)
]
),
TableRow(
children: [
Container(
alignment: Alignment.center,
height: Screen.width(80),
child: Text('黄铜', style: TextStyle(fontSize: Screen.width(28)),),
),
Text('荣誉等级', style: TextStyle(fontSize: Screen.width(28)), textAlign: TextAlign.center,)
]
),
],
)
原文地址:https://www.cnblogs.com/zhaofeis/p/12567148.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。