如何更改 flutter 中悬停在数据表上的光标?

How to change the cursor hoving on a datatable in flutter?

将鼠标悬停在 table 上时,默认光标是一只手。可以在官方文档the simple demo中看到

如何将其更改为箭头?小手暗示当你点击一行时会发生一些事情,这是误导。

将 dataTable 放入 AbsorbPointer()

已经有一个功能请求:https://github.com/flutter/flutter/issues/70755

在评论中,someone mentioned a workaround,这基本上是将整个 DataTable 包装到一个 IgnorePointer 小部件中:

IgnorePointer(
   child: DataTable(
     headingRowHeight: 0,
     showCheckboxColumn: false,
     columns: [DataColumn(label: Container()), DataColumn(label: Container())],
     rows: [...]
   ),
);

它可能有一些缺点,具体取决于您的用例,但目前肯定有效。