【发布时间】:2018-06-22 04:30:55
【问题描述】:
现在列之间有很大的空间,即使我有一个 4 个字符的标题和一个 1 到 3 位的排名值,就好像我可以在每列中放置 4 倍。
我尝试使用较小的字体,但分隔保持不变。
这是我用来设置 PaginatedDataTable 的内容。我在 Table/Row/Cell/etc 中找不到任何似乎会影响宽度的参数。这个空间似乎是自动的,但完全没有必要。谢谢。
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: const Text('Tour Rankings')),
body:
new ListView(
padding: const EdgeInsets.all(5.0),
children: <Widget>[
new PaginatedDataTable(
header: const Text('Current Rankings'),
rowsPerPage: _rowsPerPage,
onRowsPerPageChanged: (int value) { setState(() { _rowsPerPage = value; }); },
sortColumnIndex: _sortColumnIndex,
sortAscending: _sortAscending,
columns: <DataColumn>[
new DataColumn(
label: new Text('Rank', style: new TextStyle(fontSize: 8.0)),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Player d) => d.rank, columnIndex, ascending)
),
new DataColumn(
label: new Text('Prev', style: new TextStyle(fontSize: 8.0)),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Player d) => d.prevRank, columnIndex, ascending)
),...
【问题讨论】:
-
不清楚。可以提供截图+例子吗?
-
我最终创建了自己的 PaginatedDataTable 和 DataTable 实现,因此我可以调整嵌入在 Data Table 中的固定填充值并进行其他一些调整。
-
你能分享一下你是怎么解决的吗?
标签: flutter