一个用于创建具有固定表头和第一列的表格的 Flutter 小部件,支持无缝的垂直和水平滚动。它支持可展开行以查看详细数据,同时在各个平台上保持布局稳定。非常适合以响应式且用户友好的方式显示结构化数据。该包与 Android、iOS、Web、macOS、Windows 和 Linux 兼容,适用于跨平台应用。
适合场景
显示带有固定标题的大数据集
创建可展开详细信息的交互式表格
使用结构化数据构建管理仪表板
显示分层或嵌套信息
在多个平台上实现响应式数据网格
主要特点
固定表头和第一列
可展开的表格行
跨平台兼容性
平滑滚动支持
可自定义的样式选项
响应式布局设计
适合对象
数据密集型应用
管理面板和仪表板
报告工具
需要结构化数据展示的移动和Web应用
需要可重用表格组件的开发者
使用建议
可能需要额外的样式来适应复杂布局
处理超大数据集时的性能影响
有限的内置分页或筛选功能
最适合中等大小的数据集
需要仔细处理可展开行的状态管理
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
flutter_expandable_table
Expandable Table
ExpandableTable is a widget for Flutter that create a Table with header and first column fixed. You can create a nested Rows/Columns grouped in expandable Row/Column
ExpandableTable
Features
Header and first column fixed
Supports vertical and horizontal scroll
Customizable animation Duration and Curve
Specific height definition for each single row
Specific width definition for each single column
Access to cell address when building cell content
Access to the parent rows and columns of the cell while building the contents of a cell
firstHeaderCell: Is the top left cell, i.e. the first header cell.
headers: contains the list of all column headers, each one of these can contain a list of further headers, this allows you to create nested and expandable columns.
rows: contains the list of all the rows of the table, each of these can contain a list of further rows, this allows you to create nested and expandable rows.
headerHeight: is the height of each column header, i.e. the first row.
firstColumnWidth: determines first Column width size.
defaultsColumnWidth: defines the default width of all columns, it is possible to redefine it for each individual column.
defaultsRowHeight: defines the default height of all rows, it is possible to redefine it for every single row.
duration: determines duration rendered animation of Rows/Columns expansion.
curve: determines rendered curve animation of Rows/Columns expansion.
scrollShadowDuration: determines duration rendered animation of shadows.
scrollShadowFadeInCurve: determines rendered curve animation of shadows appearance.
scrollShadowFadeOutCurve: determines rendered curve animation of shadows disappearance.
scrollShadowColor: determines rendered color of shadows.
scrollShadowSize: determines size of shadows.
visibleScrollbar: determines visibility of horizontal and vertical scrollbars.
trackVisibilityScrollbar: indicates that the scrollbar track should be visible.
thumbVisibilityScrollbar: indicates that the scrollbar thumb should be visible, even when a scroll is not underway.
expanded: indicates that the table expands, so it fills the available space along the horizontal and vertical axes.