tablex 0.4.0
tablex: ^0.4.0 copied to clipboard
A production-grade Flutter data grid with zero dependency on any third-party grid engine.
0.4.0 #
New features #
-
Inline cell editing — set
enableEditing: trueon anyTablexColumnto make its cells editable. Double-tap a cell to enter edit mode; the grid renders a type-aware input widget by default:text/ default → auto-focusedTextFieldwith full text pre-selected.number/currency→ numeric keyboard, right-aligned text.boolean→ single-tap toggles the value immediately (no text input).- Custom → supply
editRendereron the column to replace the input with any widget (e.g. a dropdown, date picker, or colour swatch). - Commit with Enter or click-outside; cancel with Escape.
-
TablexColumn.onEditcallback — fired after the user commits an edit. Receives the original row object and the new typed value. The grid has already updated the cell display optimistically; use this callback to persist to your API or local state. -
TablexColumn.editRenderer— fully custom edit widget per column. Receives(BuildContext, TRow, TValue currentValue, onSubmit, onCancel). The grid wraps it in aFocusnode so Escape always cancels regardless of the widget used. -
TablexController.updateCell(rowIndex, field, newValue)— updates a single cell value in place without requiring a fullrowBuilder. Available for programmatic optimistic updates outside of inline editing. -
TablexThemeData.editInputDecoration— overrides theInputDecorationof the default text-field editor globally for a grid, without writing a per-columneditRenderer. -
Keyboard navigation in edit mode — while a cell is in edit mode, navigation keys move focus to the next cell without leaving the keyboard:
- Tab — commit and move to the next editable column; wraps to the first editable column of the next row.
- Shift+Tab — commit and move to the previous editable column; wraps to the last editable column of the previous row.
- ↓ Arrow Down — commit and move to the same column in the next row.
- ↑ Arrow Up — commit and move to the same column in the previous row.
- Arrow navigation scrolls the list automatically to keep the target cell visible.
TablexEditDirectionenum is exported for customeditRendererwidgets that want to implement the same shortcuts.
API additions #
| Symbol | Kind | Notes |
|---|---|---|
TablexColumn.onEdit |
callback | Typed (TRow, TValue) edit callback |
TablexColumn.editRenderer |
builder | Fully custom edit widget |
TablexColumnBase.handleEdit() |
method | Override to dispatch typed onEdit |
TablexColumnBase.buildEditCell() |
method | Override to supply custom edit UI |
TablexController.updateCell() |
method | Single-cell in-place update |
TablexThemeData.editInputDecoration |
field | Overrides default edit-field decoration |
TablexEditDirection |
enum | Tab / Shift+Tab / ↓ / ↑ navigation directions |
Example app #
- The I/O tab is now fully wired for inline editing:
Name(text field),Salary(numeric field),Department(dropdown viaeditRenderer), andManager(boolean toggle). Edits propagate back throughupdateRowso CSV/Excel exports reflect the latest values.
0.3.3 #
Documentation #
- Added iOS, macOS, and Web screenshots to
README.mdand registered them inpubspec.yamlunderscreenshots:so they appear in the pub.dev package carousel.
Example app #
- Removed explicit
id("kotlin-android")fromexample/android/app/build.gradle.kts— the Flutter Gradle Plugin now applies Kotlin internally, eliminating the KGP deprecation warning introduced in recent Flutter versions.
0.3.2 #
New features #
-
Cursor-based pagination —
Tablex.lazyPagednow supports opaque-cursor APIs alongside the existing offset-based mode. ReturnnextCursor(and optionallyprevCursor) from yourTablexFetchTaskand the footer switches modes automatically — no constructor flag required. Back-navigation is handled via an internal cursor history so APIs that only returnnextCursorstill support going back.TablexQuerygains acursorfield;TablexFetchResultgainsnextCursorandprevCursor.TablexPaginationInfogainsisCursorModeandhasNextPagefor customfooterBuilderimplementations. -
Redesigned pagination footer — the default footer UI has been replaced with a pill-based design: a 2 px loading strip at the top, windowed page pills (
[1] ··· [4][5][6] ··· [20]), and labelled← Previous/Next →buttons. In cursor mode the pills are replaced by aPage N(orPage N of M) indicator. TheenablePageJumpeditable-input mode is preserved. -
Default cell renderers per column type — columns without a
cellRenderernow render according to theirtype:boolean→ read-only checkbox,date/dateTime→ formatted date string,currency→ sign-aware coloured amount,number→ end-aligned text,id/identifier→ tap-to-copy monospace (unchanged). Plain text is still the fallback fortext,select, andaction.
Bug fixes #
file_pickerconstraint updated — bumped to^11.0.2.
Internal #
- Refactored
tablex_widget.dart: public API types (TablexLoadingBuilder,TablexErrorBuilder,TablexSelectionSummaryBuilder,TablexSelectionAction) moved totablex_types.dart; scroll sync, infinite-scroll, and sort logic extracted to_tablex_state_mixin.dartviapart of. - Refactored
controller.dart: CSV and Excel export/import logic moved to_controller_export.dartviapart of, keeping the reactiveChangeNotifiercore separate from serialization.
0.3.0 #
New features #
- Frozen / pinned columns — set
frozen: TablexColumnFrozen.startorfrozen: TablexColumnFrozen.endon anyTablexColumnto pin it to the left or right edge of the grid. Frozen columns remain visible while the user scrolls horizontally.- RTL-aware:
startpins to the right andendto the left in RTL locales. Shadow direction is computed fromDirectionality.of(context). - Vertical scroll is kept in sync with the main body via dedicated
ScrollControllers. Pointer scroll events and touch drag on frozen panels are forwarded to the main controller so the user can scroll from anywhere. - Sort and column resize work on frozen columns identical to scrollable columns. Drag-to-reorder is intentionally disabled for frozen columns.
- Column visibility (
hide: true) collapses a frozen panel entirely if all its columns are hidden. - Selection summary bar spans the full width of all three panels.
- RTL-aware:
0.2.1 #
Bug fixes #
- WASM compatibility — file import (
FilePicker.pickFiles) is now behind a conditional export sodart:iois never imported on web or WASM.dart.library.js_interoproutes to an HTML<input type="file">+FileReaderimplementation instead. - Formatting — all library files now pass
dart format. - Dependency lower-bound fix — tightened
excelconstraint to^4.0.6(the version that introducedTextCellValue.valueasTextSpan); the previous^4.0.0caused a type error underdart pub downgrade. - Updated
file_pickerto^11.0.0— aligns with the current stable release and migrates call sites from the removedFilePicker.platform.*instance methods to the newFilePicker.*static API.
0.2.0 #
New features #
TablexConsumer— high-level widget that wrapsTablex.lazyPagedwith a bordered container, optional title/filter header slots, automatic filter-chip bar, and controller lifecycle management.- Sliding-window infinite scroll —
Tablex.infinitenow accepts awindowPagesparameter. Old pages are evicted as new ones arrive; scroll-position compensation viajumpTokeeps the viewport stable. - Skeleton loading —
TablexLoadingBuilderpre-populates the grid with placeholder rows so a shimmer library (e.g. Skeletonizer) has real content to animate over, on bothlazyPagedandinfinitegrids. - Custom pagination footer —
footerBuilderonTablex.lazyPagedandTablexConsumerfully replaces the default footer.enablePageJumpmakes the page indicator an editable text field. TablexToolbar— drop-in toolbar with column-visibility management, CSV export (formula-injection protected), Excel export, CSV import, and Excel import. Each action can be overridden individually.prependRows/removeFirstRows/removeLastRowsonTablexController— used internally by the sliding-window but available for manual row management.- Sort race-condition guard — a generation counter on
Tablex.infiniteensures that in-flight fetch results are discarded when a sort or reset fires before they resolve.
Bug fixes #
- Fixed infinite-scroll first-page load using
appendRowsinstead ofreplaceRowsafter a sort reset, causing skeleton rows to persist above the sorted results. - Fixed header row being included in the skeleton loading scope, causing column headers to shimmer on re-fetch.
Tests #
- Added 13 unit tests for the sliding-window controller methods (
prependRows,removeFirstRows,removeLastRows). - Added 26 widget + unit tests covering
TablexQuery.copyWith, static sort (ascending, descending, clear, icons), lazy-paged fetch (initial query, sort re-fetch, error state, custom error widget), and infinite-scroll (skeleton replace, sort re-fetch, stale-result discard).
0.1.0 #
- Initial release.
- Four grid modes:
static,lazyPaged,infinite, andselect. - Built-in cell renderers:
identifier,twoLine,avatarTwoLine,currency,date,statusChip,actions. - Column resizing, sorting, and column-visibility manager.
- Three density presets:
compact,standard,comfortable. - Multi-row selection with customisable summary bar and bulk actions.
- Theming via
TablexThemeData. - i18n support via
slang.
