grid_sheet 2.0.0
grid_sheet: ^2.0.0 copied to clipboard
A powerful Flutter DataGrid/DataTable for large datasets, offering Excel-like features and fully customizable cells — ready with minimal setup. See README for full features
Changelog #
2.0.0 #
Breaking Changes #
GridSheetConfiguration.rowHeighthas been deprecated in favor ofGridSheetRow.height, allowing row height to be configured on a per-row basis.deleteRowsAtanddeleteRowsByKeysnow returnFuture<List<ValueKey<String>>>instead ofFuture<int>.GridSheetLayoutConfigurationhas been renamed toGridSheetConfiguration. A deprecated type alias is provided for backward compatibility.GridSheetgridManagerHelpershas been renamed toGridSheetManagerHelpers.
New Features #
- Added an opt-in column reveal animation through
GridSheetAnimationConfiguration(configured viaGridSheet.animationConfiguration). Whenenabledistrue, columns are revealed with a staggered slide-and-fade animation on the initial grid build—pinned-left columns animate first, followed by scrollable columns. The animation is customizable usinganimationDuration,curve, andslideDistance, and is disabled by default. - The column reveal animation plays once when the grid is first mounted and automatically replays after pagination changes (
goToPage,nextPage,previousPage, andchangeRowsPerPage). - Added
animateRowsOnSortOrFilter, which replays the same staggered slide-and-fade animation for rows (top to bottom) whenever the current page is re-sorted or re-filtered. This animation reusesanimationDuration,curve, andslideDistance, and intentionally performs a fresh reveal rather than animating rows from their previous positions to their new positions. - When
animateRowsOnSortOrFilterandreplayOnPageChangeare both enabled, the row reveal now also replays forserverSidePaginationpage changes (the same full-page cascade used for sort/filter), and forinfiniteScrollbatch loads — where only the newly-appended rows animate, leaving already-visible rows untouched. Client-side pagination continues to never trigger a row reveal. - Added
cellChangeFlashEnabled, which briefly flashes a cell's background whenever its value changes due to a direct edit or a dependent formula recalculation. The flash behavior is customizable viacellChangeFlashColorandcellChangeFlashDuration. Bulk or initial formula evaluation (initial mount, pagination, sorting, filtering, andrefreshAllFormulas) does not trigger the animation. Autofill, paste, and CSV import are not yet supported. - Added
columnVisibilityFadeEnabled, which animates both a column's width and opacity overanimationDurationwhen columns are shown (showColumns) or hidden (hideColumns). During the transition, columns to the right slide smoothly into or away from the expanding/shrinking space in sync with the fade, creating a seamless layout transition without leaving a temporary gap or causing columns to jump after the animation completes. - Added
insertRowsandinsertColumnstoGridSheetManagerfor inserting rows or columns relative to the current selection. Insertion behavior is configurable throughGridSheetRowInsertPosition,GridSheetColumnInsertPosition, and the newrowInsertPosition/columnInsertPositionconfiguration options. - Added
defaultValuestoinsertRowsandinsertRowsAtto populate newly inserted rows with either a single value, per-column values, ornull(default). - Added
refreshAllFormulasto recompute formulas across the entire dataset. CSV exports now automatically refresh all formulas before exporting, ensuring exported values are always up to date. - Added
selectionIncludesPinnedLeftCellsandconditionalFormatIncludesPinnedLeftCellsto optionally extend selection highlighting and conditional formatting into pinned-left columns. - Added
showOnlyEditableColumnstoGridSheetRowExpansionConfiguration. The built-in row expansion form now displays only editable columns by default. - Added
pinColumnsToLeft,clearPinColumns,pinnedLeftColumns, andactiveColumnsto simplify programmatic column pinning and management. rowStateColorBuilder,rowStateIconBuilder, andsortIconBuildernow support returningnull, allowing the grid to gracefully fall back to default behavior.- Added
GridSheetRow.resetHeightto restore a single row's height back to the value it was constructed with. - Added
GridSheetManager.getCellFormulato read back a formula cell's raw formula text (e.g.=A1+B1) through the public interface, returningnullfor a non-formula cell or an unknown row/column key. exportToCSVnow supports anonlyCurrentPageRowsparameter to restrict export to the current page's rows, matching the option already available onexportToCSVWithFormulas.
Performance Improvements #
- Optimized formula recalculation so only dependent formulas are recomputed after cell edits.
- Improved formula initialization performance by eliminating unnecessary dependency graph copying.
- Replaced recursive circular-reference detection with an iterative implementation to prevent stack overflows on large dependency chains.
- Optimized bulk row deletion using a single-pass algorithm.
- Eliminated unnecessary full-grid rebuilds during column resizing.
- Reduced selection border rendering overhead by avoiding repeated page-row allocations.
- Optimized overflow tooltip detection by reusing cached text measurements.
Improvements #
- Formula dependency graphs are now correctly remapped after row or column insertion, deletion, sorting, reordering, and reset operations.
GridSheetConfigurationnow automatically synchronizes when updated by parent widget rebuilds.- Improved server-side pagination by discarding stale responses from overlapping page requests.
- Added graceful error handling for failed server-side page requests, preventing unhandled async exceptions.
- Improved built-in row expansion interaction so row selection and expansion no longer conflict.
selectColumnAcrossAllPagesnow correctly controls the default behavior of selected-column retrieval APIs.resetAllRowHeightsnow restores each row to the height it was individually constructed with, instead of collapsing every row to a single shared default height.
Bug Fixes #
This release includes numerous stability and correctness improvements across the grid, including fixes for:
- Formula dependency synchronization after structural changes.
- Formula undo history being lost after row or column operations.
- Autofill corruption after sorting or structural modifications.
- Incorrect autofill pattern detection for inconsistent numeric sequences.
- Selection rendering issues involving pinned-left and serial-number columns.
- Hover synchronization between pinned-left and scrollable row sections.
- Hidden columns retaining stale selection state.
- Reload operations leaving stale row selection or expanded-row state.
- Row duplication sharing mutable data with the original row.
- Stale cell listeners after column insertions or deletions.
- Row disposal not being idempotent.
- Context menu visibility incorrectly depending on row context menu configuration.
- Runtime type errors when assigning
nullto mixed-type row data. LEFT,RIGHT, andMIDthrowingRangeErrorinstead of returning formula errors.- Improved JSON import validation with descriptive
FormatExceptions. - Multiple rendering, pagination, caching, rebuild, documentation, and API compatibility issues.
insertColumnsAt/insertColumnsthrowing an uncaughtTypeErrorwhen inserting a formula-type column without matchingdefaultValues— the defaultnullcell value is no longer routed into formula evaluation unless it's actually a formula string.exportToCSV/exportToCSVWithFormulasno longer write a cell value that starts with=,+,-, or@unescaped — such values are now prefixed to prevent formula/DDE injection when the exported file is opened in a spreadsheet application, while an intentionally-exported formula (viaexportToCSVWithFormulas'sincludeFormulas) still keeps its leading=.- Infinite-scroll fetches now share
_goToPage's request-staleness guard, so a sort/filter/reload that fires while a scroll-triggered fetch is still in flight no longer lets the stale response merge rows from the old sort/filter state into the freshly-reloaded rows. exportToCSVWithFormulas'sincludeFormulas: truenow actually exports formula cells' live formula text instead of always exporting the evaluated value — the internal check used to look up a cell's formula never matched through any public entry point, so this option was silently a no-op.- A
GridSheetconfigured with onlyinfiniteScroll: true(without also settingserverSidePagination: true) now correctly auto-fetches page 1 on mount, matchinginfiniteScroll's documented behavior of implying server-side pagination on its own.
API Changes #
- Added
pinColumnsToLeft,clearPinColumns,pinnedLeftColumns, andactiveColumnsfor programmatic pinned-column management. - Renamed
freezeColumnsUptoIndextopinColumnsLeftUptoIndex. The previous API remains available as a deprecated alias. - Deprecated
freezeColumnsUptoKeyin favor ofpinColumnsLeftUptoIndex. - Renamed
GridSheetColumn.pinnedLefttopinnedLeft, for consistency withpinColumnsLeftUptoIndex/pinColumnsToLeft. The previous field remains available as a deprecated alias. - Renamed
GridSheetColumnContextInfo.isFrozentoisPinnedLeft. The previous getter remains available as a deprecated alias. - Renamed
GridSheet.onCellValueChangetoonCellValueChanged, matching the past-tense naming ofonColumnsSelected/onRowsSelected/onCellsSelected. The previous callback remains available as a deprecated alias. - Fixed a typo in
exportToCSV'sonlyCurrentpageRowsparameter — the correctly-spelledonlyCurrentPageRowsis now the canonical name; the misspelled parameter remains available as a deprecated alias. - Deprecated
GridSheetConfiguration.rowHeight, in favour ofGridSheetRow.height. - Renamed
GridSheetgridManagerHelperstoGridSheetManagerHelpers. - Renamed
TokenandTokenTypetoGridSheetFormulaTokenandGridSheetFormulaTokenType. Deprecated aliases remain available for backward compatibility. - Restored deprecated compatibility shims for
enableReorderandreorderColumnsByOrder.
Default Changes #
- Default
GridSheetConfiguration.rowsPerPagechanged from 50 to 30. - Default
GridSheetStyleConfiguration.gridBorderRadiuschanged from 4px rounded corners to square corners.
1.3.1 #
- Added
row expansionfeature support — to expand an inline sub-panel (a child table, a form, extra fields). - Added new property
descriptioninGridSheetColumn— useful for abbreviated column names descriptions. - Added manual and scheduled auto-reload with reload callbacks and runtime controls.
- Added
rowsLoaderfor refreshing client-side data without rebuilding. - Added
updateConfigurationfor updating non-structural layout settings at runtime. - Added cell tooltip on overflow — when cell text is truncated, show a tooltip on hover with the full value.
- Fixed reload lifecycle, auto-reload scheduling, and error handling.
- Fixed rows-per-page sync and infinite-scroll reload rollback.
- Fixed missing fields in
GridSheetLayoutConfiguration(copyWith, equality,hashCode, andtoString). - Fixed
evaluateFormulareturn type. - Fixed
fillCells(increment: true)correctly incrementing numeric values.
1.3.0 #
- Added
server-side (lazy pagination),infinity-scrollpaginations feature support - Added row-reordering feature support
- Added cell type
GridSheetColumnType.dropdown— built-in dropdown/select cells feature support - Renamed
enableReorderproperty toenableColumnReorder - Renamed
reorderColumnsByOrdermethod toreorderColumnsByPositions - Fixed performance issue when switching theme.
- Fixed cell level conditional format issue when reordering columns
1.2.9 #
- Optimized internal code for better overall performance and stability
- Fixed minor bugs
1.2.8 #
- Optimized internal code for better overall performance and stability
- Added row resize functionality
- Added
Unique Countaggregation - Added support of
showColumnHeaderRowoption inlayoutConfiguration - Added support of
ascSortIconColor,descSortIconColoroptions instyleConfiguration
1.2.7 #
- Enhanced Pagination
- Optimized code and improved performance
1.2.6 #
- Added support of column level aggregations
- Fixed some issues
1.2.5 #
- Performance Optimization
- Added support of new option filterPosition in GridSheetConfiguration
- Fixed some issues
1.2.4 #
- Refactor: replace expression style fields with static-based text style
BREAKING CHANGE: removed
textStyleExpression— usetextStyleinstead
1.2.3 #
- Refactor: replace static color/style fields with expression-based conditional formatting API
BREAKING CHANGE: removed
expression,backgroundColor,fontStyle— usebackgroundColorExpressionandtextStyleExpressioninstead
1.2.2 #
- Added dynamic table generation: tables can now be generated at runtime based on
columnsCountandrowsCount. - Added
renameColumnsmethod: allows renaming of column names and optional titles.
1.2.1 #
- Refactored internal auto-fill logic to reduce code duplication and improve maintainability.
- Added
loadingOverlayColoroption in styleConfiguration
1.2.0 #
- Provided support of autofill(cell drag-to-copy) feature.
1.1.9 #
- Fixed Undo Feature issue with formula type columns
1.1.8 #
- Fixed issues related to formula type
- Added ISBLANK, ISNUMBER, ISTEXT formula functions
1.1.7 #
- Updated example to demonstrate light and dark theme support
- Provided support of formula type cell feature.
1.1.6 #
- Added default norowswidget
1.1.5 #
- Added issue_tracker link in pubspec file
1.1.4 #
- Updated package description within pub.dev limits
1.1.3 #
- Updated example with latest code
1.1.2 #
- Fixed select all issue
1.1.1 #
- updated license
1.1.0 #
- Added row on hover feature.
- Added headerWrapper feature.
- Added filterWrapper feature.
- Added rowWrapper feature.
1.0.5 #
- Added sample example.
1.0.4 #
- Removed prints.
1.0.3 #
- Removed theming classes.
1.0.2 #
- Removed unrequired classes.
1.0.1 #
- Removed unrequired passages.
1.0.0 #
- Initial release of GridSheet.
- Added row and column operations.
- Added sorting, filtering, pagination, and selection support.