flutter_table_layout 0.1.4
flutter_table_layout: ^0.1.4 copied to clipboard
Responsive data table for Flutter with frozen columns, sorting, filtering, grouping, editing, and Excel/PDF export for mobile, web, and desktop.
Changelog #
0.1.4 #
Skeleton / shimmer loading (new) #
loadingStyle: TableLoadingStyle.skeletonshows placeholder rows shaped like the visible columns (placeholder cards on phones) with a shimmer sweep while there are no rows yet — including the first page of a server-sidedataSource. The default staysTableLoadingStyle.spinner, andloadingWidgetstill takes precedence.skeletonRowCount(default: the page size, at most 10).AdaptiveTableTheme.skeletonBaseColor/skeletonHighlightColor(derived from the row text color by default, so every built-in theme works in light and dark).- The sweep follows the text direction (RTL) and stops when the platform asks to reduce motion.
- Reusable building blocks:
TableSkeleton,TableShimmer,SkeletonBox. No new dependency.
0.1.3 #
Fixes #
- Date panel popped the page underneath (web / wide screens): pressing Apply in the date range panel closed it with the caller's
Navigator, not the dialog's. With go_router'sShellRoute(a nested navigator under the root one that hosts the dialog) this popped the current page instead, throwing "You have popped the last page off of the stack" followed by!_debugLockederrors. The panel now closes through its own route context. Covered by a regression test with a nested navigator.
0.1.2 #
Release automation #
- Versions are now published to pub.dev automatically from GitHub Actions when a
v{{version}}tag is pushed.
Fixes #
- Column resize in RTL felt inverted: grid rows were anchored to the left in right-to-left layouts, so widening a column moved the opposite edge. Rows now start at the right in RTL.
- Resize edge didn't follow the pointer: flexible columns before the resized one absorbed the change. They are now frozen during the drag; only the columns after it adapt. Covered by 8 tests (LTR/RTL × fixed/flex × grow/shrink).
Date filter redesign (new) #
- The two From / To buttons (each opening the same full calendar) are replaced by a single "Period" button. It opens a panel with quick periods (all, today, yesterday, last 7 / 30 days, this / last month, this year), a two-month range calendar and typed From / To fields. On phones it opens as a bottom sheet.
datePresets/DateRangePresetfor custom periods,showTableDateRangePicker/DateRangePanelfor standalone use.dateFilterStyle: DateFilterStyle.separateFieldskeeps the previous look.
0.1.1 #
- Fixes and improvements.
0.1.0 #
A full audit and overhaul. The public API is backward compatible: existing code keeps compiling, and the original tests pass unchanged.
Bug fixes #
- Date filter: clearing a date (✕) did nothing because
copyWithcouldn't reset nullable fields.TableStateModel.copyWithnow hasclearStartDate/clearEndDate/clearSort. - Columns menu: toggling a column threw
ProviderNotFoundException(the popup lives outside theBlocProvider), and its checkboxes didn't update. - Web export: nothing was downloaded (the download code was commented out). Rewritten with
package:web. showPagination: false: only the first 10 rows were ever shown.pageSizeswithout 10: the rows-per-page dropdown crashed.- Data updates: changing the
itemslist in place (add / remove followed bysetState) did not refresh the table. TableCubitmutated the caller's column list, and crashed when given aconstlist.- Exports: columns hidden by the user were still exported.
- Word export: values were not HTML-escaped, so
<,&or quotes broke the document. - Excel export: invalid sheet names (
/,:, more than 31 characters) produced corrupted files. Also fixed the fragile default-sheet deletion. - RTL: pagination arrows were flipped twice, and column alignment ignored RTL.
- Sorting: crashed on mixed value types, was case-sensitive, not stable, and placed
nulls inconsistently. - Pagination: the current page was not clamped after filtering or deleting (it showed "No data" while data existed), and an empty table showed "Page 1 of 0".
- Filters: the date pickers were shown even without a
dateProvider. The picker crashed wheninitialDatewas outside 2000–2100. - Row details:
expandedRowBuilderonly opened for selected rows (impossible whenshowSelection: false), andonRowTapwas ignored on mobile. - Footer: the page numbers could overflow on phones when there were many pages.
- Toolbar: it overflowed on narrow screens, and snackbars used a
BuildContextacross async gaps. - Theme: the default theme was always light, even in dark apps. Many colors were hard-coded blue.
- Dynamic form:
- any name containing "is" (
discount,wishlist…) was detected as a boolean; - a required dropdown displayed its first item but submitted
null; - an invalid dropdown initial value crashed;
- the date field ignored
isRequired; - custom validators only ran for text fields;
- the internal mutable map was leaked to callers.
- any name containing "is" (
- Removed dead placeholder code in
FilterItemsUseCase.execute, which now works and sorts. - Fixed every analyzer deprecation (
withOpacity,dart:html,Share.shareXFiles,DropdownButtonFormField.value,Switch.activeColor).
Advanced grid (new) #
- Frozen columns:
pin: ColumnPin.start / end, pin/unpin from the columns menu, LTR and RTL. Implemented with a customRenderPinnedRow. - Sticky header + virtualized rows:
bodyHeight/fillHeight. Only visible rows are built (tested with 100,000 rows). - Column resize (drag the header edge, double-click to reset), drag & drop reorder (long-press), and "Reset columns".
- Per-column filter row (
showColumnFilters) withColumnFilterMatcherexpressions (>10,10..20,=x,!=x,!x, dates,a, b). - Multi-column sort (Shift + click,
setSorts,addSort) with level badges. - Row grouping (
groupByColumnId, collapsible groups,groupHeaderBuilderwithTableGroupInfo), on desktop and mobile. - Inline cell editing (
isEditable,CellEditor.text / number / dropdown / date / boolean,cellValidator,onCellEdited,canEditCell), with Enter / Tab / Escape. - Keyboard navigation: arrows, Enter / F2, Space, Tab, Home / End, Page Up / Down, Ctrl + A, Escape.
- Server-side data:
AdaptiveTableDataSource/TableDataPage, stale-response protection, automatic last-page clamping, and a Retry button on errors. TableStateModelgainedadditionalSorts,columnFilters,groupByColumnId,sorts.TableLoadedgainedcolumnWidths,columnOrder,columnPins,collapsedGroups,isFetching,arrange()andpinOf().- Mobile cards are virtualized too when the table has a bounded height.
- Exports follow the user's column order.
New #
layoutMode(TableLayoutMode.auto/table/cards) to force the grid on phones or cards on desktop.onExportRequested/onPrintRequestedto plug in your own export and print implementations.AdaptiveTableControllerto search, filter, sort, paginate and select from outside.onSelectionChanged,onTableStateChanged,onRowLongPress,rowColorBuilder,toolbarActions,isLoading,showClearFilters,showDateFilter,initialPageSize,initialSortColumnId/initialSortAscending,mobileBreakpoint,mobileTitleColumnId/mobileSubtitleColumnId,searchDebounce,firstDate/lastDate.- Column options:
valueFormatter,isSearchable,isExportable,isHideable.fieldNameis now optional. TableExportOptions: file name, formats, PDF fonts and page format, "export selected rows only", and a customonExporthandler.AdaptiveTableLabelswith English and Arabic built in, chosen from the app locale.AdaptiveTableThemeis now aThemeExtension(copyWith,lerp,AdaptiveTableTheme.of), with anadaptivepreset and newaccentColor,onAccentColor,selectedRowColor,titleTextStyle,toolbarIconColor,summaryBackgroundColorandblurSigma.- Tri-state "select all", numbered pagination, "Showing 11–20 of 48", a search clear button, a "Clear filters" button, and separate "no data" vs "no results" states.
- PDF: cached Cairo font with a timeout, custom fonts, automatic landscape, column widths and alignments.
- Excel: typed date cells, RTL sheets, automatic column widths.
- Desktop exports are saved to the Downloads folder, and the saved path is shown.
TableCubit:sortBy,clearSort,setCustomFilter,resetFilters,resetAll,setSelection,setColumnVisibility,toggleRowExpansion,updateConfiguration,nextPage/previousPage. It emitsTableErrorinstead of crashing.FilterItemsUseCase.applyreturnsTableQueryResult(withtotalPagesandeffectivePage). Supports hidden columns and search-only keys.DynamicFormField:hint,helperText,enabled,maxLines,firstDate/lastDate,copyWith, andinferType/tokenize.detectFromColumnsgainedfieldTypes,excludeIdsandoptionalIds.DynamicFormDialog.showreturns the submitted values.
Behaviour changes #
- An empty, optional number field now submits
nullinstead of0. - Exports use the selected rows when there is a selection (turn this off with
TableExportOptions(exportSelectedWhenAny: false)). saveAndShareFilereturnsFuture<String?>(the saved path or file name).
Project #
- 135 package tests + 6 example smoke tests (previously 7), a CI workflow, stricter lints, a rewritten README with screenshots, and a rebuilt example app with all platforms.
0.0.2 #
- Dynamic Form Generator:
- Implemented
DynamicFormFieldschemas with automatic field type detection (inferred from column properties like name patterns for dates, numbers, booleans, and dropdown lists). - Created
DynamicFormandDynamicFormDialogwith fully-validated inputs, customized actions, and submit callback events.
- Implemented
- Premium Adaptive Themes:
- Added
AdaptiveTableTheme.glassmorphicfeaturing iOS-like real-time backdrop blur filter overlay (BackdropFilter) and translucency. - Added
AdaptiveTableTheme.gradientimplementing styling sweeps across headers and footers. - Added
AdaptiveTableTheme.cozysupporting soft shadows and expanded spacing.
- Added
- CRUD Action Handlers & Settings:
- Integrated interactive styling picker inside the AppBar settings.
- Replaced static action buttons with CRUD dialog triggers utilizing the dynamic forms generator.
- Validation & Testing:
- Added comprehensive unit and widget tests covering type detection, validation logic, and form state submissions.
0.0.1 #
- Initial release of the adaptive data table layout.
- Responsive layouts automatically adapting between desktop data grids and collapsable mobile cards.
- Localized global searching, date-range filtering, and pagination support.
- Multi-currency aggregate bottom banner summary builder.
- Integrated Excel, Word, PDF, and system printing exporters with shaped Arabic font support.
