DataTable使用示例
ListView( //使用ListView的目的是让列表能够滚动
scrollDirection: Axis.horizontal,
children: <Widget>[
DataTable(columns: [
DataColumn(
label: Text('时间'),
),
DataColumn(label: Text('组织')),
DataColumn(label: Text('球队')),
DataColumn(label: Text('人员'), numeric: true),
], rows: [
DataRow(selected: true, cells: [
DataCell(Text(
'2010-03-15 \n 14:30:00',
style: TextStyle(
color: CustomStyle.themeColor,
fontWeight: FontWeight.bold,
fontSize: 16,
fontStyle: FontStyle.italic),
)),
DataCell(Text('NBA')),
DataCell(Text('LA')),
DataCell(Text('NBA')),
]),
DataRow(cells: [
DataCell(Text('2010-03-15 \n 14:30:00',
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontSize: 16,
fontStyle: FontStyle.italic))),
DataCell(Text('NBA')),
DataCell(Text('LA')),
DataCell(Text('NBA')),
]),
DataRow(cells: [
DataCell(Text('2010-03-15 \n 14:30:00',
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontSize: 16,
fontStyle: FontStyle.italic))),
DataCell(Text('NBA')),
DataCell(Text('LA')),
DataCell(Text('NBA')),
]),
DataRow(cells: [
DataCell(Text('2010-03-15 \n 14:30:00',
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontSize: 16,
fontStyle: FontStyle.italic))),
DataCell(Text('NBA')),
DataCell(Text('小明')),
DataCell(Text('小明')),
]),
])
],
)
效果展示
WechatIMG58.png
网友评论