확장 가능한 행을 갖춘 상호작용식 테이블 뷰를 가능하게 하는 플러터 패키지입니다. 사용자가 데이터를 효율적으로 볼 수 있고 수정할 수 있도록 지원합니다. 자세한 정보를 위해 동적 행 확장을 지원하여 계층 구조 또는 복잡한 데이터 세트를 표시하는 데 이상적입니다. 이 패키지는 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼에서 호환됩니다. 중첩된 콘텐츠가 있는 대규모 테이블을 관리하기 위한 깔끔하고 사용자 정의 가능한 인터페이스를 제공합니다.
사용 사례
계층적 데이터 표시
인라인으로 테이블 항목 편집
세부 행 정보 표시
작은 뷰에서 대규모 데이터셋 관리
반응형 데이터 그리드 만들기
주요 기능
사용자 정의 콘텐츠를 가진 확장 가능한 행
내장된 편집 지원
크로스 플랫폼 호환성
사용자 정의 스타일링
다양한 화면 크기에 맞는 반응형 레이아웃
적합한 대상
데이터 집약형 애플리케이션
관리자 대시보드
보고 도구
재고 관리 시스템
사용자 중심의 데이터 테이블
고려 사항
매우 큰 데이터 세트와 함께 성능에 영향을 줄 수 있습니다
편집을 위해 신중한 상태 관리가 필요합니다
제한된 내장 정렬/필터링
중간 수준의 행 수에 가장 적합
복잡한 상호작용에 대한 수동 처리가 필요합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Expandable DataTable
A Flutter package for displaying and editing tabular data with expandable rows. Overflow columns collapse into a tappable expansion panel, keeping the table clean on any screen size.
What it does
expandable_datatable renders a data table where you control how many columns are visible. Columns that exceed visibleColumnCount are hidden from the row and instead displayed inside a collapsible expansion panel. This lets you show a clean, narrow table on phones while surfacing all data on demand - without writing custom layout code.
When should I use it?
Use ExpandableDataTable whenever you need a data table that:
has more columns than fit on the current screen, and
you want the extra columns to be accessible without horizontal scrolling.
Features
Expandable rows - hidden columns fold into a tappable expansion panel per row
Responsive column count - drive visibleColumnCount from LayoutBuilder to adapt automatically to screen width
Column sorting - tap any header to toggle ascending / descending sort
Pagination - built-in page controls, fully replaceable with a custom widget
Editable rows - built-in edit dialog pre-filled from cell values; or supply your own via renderEditDialog
Extensible cell types - plug in CellType<T> adapters (ImageCellType, custom DateTime, etc.) to encapsulate rendering, sorting, and editing
Custom cell rendering - override the default cell widget for any column via cellBuilder on ExpandableColumn
Per-column edit guard - mark individual ExpandableColumns as isEditable: false to make them read-only inside the dialog
Custom expansion content - replace the default expansion panel body via renderExpansionContent
Multiple or single row expansion - control via multipleExpansion
Comprehensive theming - colors, text styles, borders, shapes, icons, animation and more via ExpandableTheme / ExpandableThemeData
Screenshots
Sorting
Expansion
Editing
Styling
Getting started
Add expandable_datatable as a dependency in your pubspec.yaml file. See the pub.dev install tab for details.
Quick example
Below is a minimal working snippet. See example/lib/main.dart for a complete runnable app.
Tip:ExpandableColumn is generic — pass the Dart type of the data (int, String, etc.) so the library can handle sorting and editing correctly.
Core API
TL;DR - use ExpandableDataTable(...) as your main table widget; see the quick example above for setup and theming.
What is ExpandableDataTable?
ExpandableDataTable is the main widget of this library. It renders the full table UI including the header row, data rows, expansion panels, sort indicators, pagination, and (optionally) the edit dialog. Everything else in the library - ExpandableColumn, ExpandableRow, ExpandableCell, ExpandableTheme - exists to configure and feed data into this widget.
Key properties of ExpandableDataTable
Property
Description
headers(required)
Column definitions (title, flex, editability). Must align with the row cell list.
rows(required)
The data. Each ExpandableRow holds one ExpandableCell per header.
visibleColumnCount(required)
Number of columns shown in the row; the rest go into the expansion panel.
pageSize
Number of rows per page. Defaults to 10.
expansionIconAffinity
Where the expansion icon appears (leading or trailing). Defaults to trailing.
multipleExpansion
Whether multiple rows can be expanded at the same time.
isEditable
Flag indicating whether rows are editable. Requires onRowChanged.
onRowChanged
Called when a row is edited; originalIndex is the row's index in your rows list.
onPageChanged
Called when the current page changes.
editDialogTitle
Title text of the built-in edit dialog. Defaults to 'Edit Details'.
editSaveLabel
Label of the save button in the built-in edit dialog. Defaults to 'SAVE'.
editCancelLabel
Label of the cancel button in the built-in edit dialog. Defaults to 'CANCEL'.
nullValuePlaceholder
Text shown when a cell's value is null. Defaults to an empty string.
renderEditDialog
Replaces the built-in edit dialog. Use onSuccess(newRow) to commit.
renderCustomPagination
Replaces the built-in pagination widget.
renderExpansionContent
Replaces the default expansion panel content for each row.
Theming with ExpandableTheme
Wrap ExpandableDataTable with ExpandableTheme anywhere in the tree above the table. The table reads it automatically via ExpandableTheme.of(context). If no ExpandableTheme is present, sensible defaults from ExpandableThemeData() are used.
By default each cell renders its value as Text(value.toString()) — except ImageProvider columns, which render an Image widget. To take full control of how a column's cells look, set cellBuilder on the ExpandableColumn:
cellBuilder receives (BuildContext context, dynamic value) and must return a Widget. It applies everywhere the column appears — both in the visible row and in the expansion panel.
Tip: When a column has a cellBuilder, the default rendering (plain text or image) is completely bypassed. You are responsible for handling null values if your data can contain them.
Extensible cell types (CellType<T>)
Instead of writing one-off callbacks or handling branching across multiple files, you can provide a CellType<T> adapter to ExpandableColumn to encapsulate rendering, sorting, editing, and string formatting in one reusable object.
Built-in ImageCellType
Declaratively configure image height, fit, alignment, and border radius without writing a custom builder:
When rendering cells in both the visible row and expansion panel, the table evaluates:
ExpandableColumn.cellBuilder(highest priority)
ExpandableColumn.cellType
Built-in type inference (fallback)
Editing
Set isEditable: true to show an edit icon on every row. The built-in dialog pre-fills each field from the current cell values. You must provide onRowChanged when editing is enabled:
Contributions are welcome! Please open a pull request on GitHub. A CONTRIBUTING.md with branch naming and testing guidelines does not yet exist — feel free to propose one.