flutter table使用方法
作者:互联网
/** * 表格 * 表格的每一行的高度,由其内容决定,每一列的宽度,则由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,)
]
),
],
)
标签:TextStyle,Screen,28,flutter,width,fontSize,table,方法,children 来源: https://www.cnblogs.com/zhaofeis/p/12567148.html