flutter - Flutter 数据表问题
问题描述
我想在 DataTable 中为 DataRow 实现可关闭或滑动操作。到目前为止,我只能在列表中找到主要使用/显示的此类功能。我使用 DataTable 的原因是因为我想显示水平滚动可用数据列表并显示为数据表样式。这是我的代码,如果有任何可用的指针,我将不胜感激。
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
columns: [
DataColumn(label: Text('Date')),
DataColumn(label: Text('Customer')),
DataColumn(label: Text('Amount'), numeric: true),
DataColumn(label: Text('Remark')),
],
rows: snapshot.data
.map(
(item) => DataRow(
cells: [
DataCell(Text(
DateFormat('yyyy/MM/dd').format(item.date))),
DataCell(Text(item.customerName)),
DataCell(
Text(NumberFormat().format(item.amount))),
DataCell(Text(item.remark)),
],
),
)
.toList(),
),
),
谢谢!
解决方案
推荐阅读
- docker - docker pull 中发生错误
- c# - 更改分离子对象的父级 - 实体框架 6
- r - 根据条件创建新的数值变量
- java - 在动态 LinearLayout 中添加 RadioGroup
- java - loadClass((“完全限定的类名”)和之间有什么区别
.class.getDeclaredConstructors - javascript - 使用 jxbrowser javafx 访问媒体
- listview - JavaFX ListView 滚动导致数据访问负载
- php - 在 docker 容器中为 php 启用soap
- facebook - 跟踪facebook朋友的编程语言是什么
- android - Android Casting 自定义视图