Package selection guidance compiled from public package information, community data, and project usage.
A Flutter package that enables interactive table views with expandable rows, allowing users to view and edit data efficiently. It supports dynamic row expansion for detailed information, making it ideal for displaying hierarchical or complex datasets. The package is compatible across all major platforms, including mobile, web, and desktop. It provides a clean, customizable interface for managing large tables with nested content.
Use cases
Displaying hierarchical data
Editing table entries inline
Showing detailed row information
Managing large datasets in a compact view
Creating responsive data grids
Key features
Expandable rows with custom content
Built-in editing support
Cross-platform compatibility
Customizable styling
Responsive layout for different screen sizes
Suitable for
Data-heavy applications
Admin dashboards
Reporting tools
Inventory management systems
User-facing data tables
Considerations
May impact performance with very large datasets
Requires careful state management for edits
Limited built-in sorting/filtering
Best suited for moderate row counts
Needs manual handling of complex interactions
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
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.