worksheet 1.4.0
worksheet: ^1.4.0 copied to clipboard
High-performance Flutter spreadsheet widget supporting large datasets, 10%-400% zoom, and GPU-optimized tile-based rendering.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
1.4.0 - 2025-02-02 #
Added #
- Flutter
Shortcuts/Actionspattern for keyboard handling — enables consumers to override, extend, or remap any keyboard shortcut Worksheet.shortcutsparameter — custom shortcut bindings merged on top of defaultsWorksheet.actionsparameter — custom action overrides merged on top of defaultsDefaultWorksheetShortcuts— static map of ~44 default shortcut bindings (bothcontrol:andmeta:variants for cross-platform)- 13 Intent classes (
MoveSelectionIntent,GoToCellIntent,ClearCellsIntent, etc.) - 13 Action classes with
WorksheetActionContextinterface for dependency injection WorksheetActionContext— abstract interface implemented by the widget state, avoiding 6+ constructor params per Action- New shortcuts: Ctrl+C/X/V (copy/cut/paste), Ctrl+D (fill down), Ctrl+R (fill right), Delete/Backspace (clear cells)
Worksheet.editControllerparameter for integrated cell editing — rendersCellEditorOverlayinternally, handles type-to-edit, commit-and-navigate, and F2/double-tap editing- Type-to-edit: printable characters start editing the focused cell with that character as initial content
- Commit-and-navigate: Enter (down), Shift+Enter (up), Tab (right), Shift+Tab (left) commit the edit and move selection
CellEditorOverlay.onCommitAndNavigatecallback for directional commit with row/column delta- Arrow keys commit the edit and navigate when editing (via
CellEditorOverlay) - Tap outside the editing cell commits the current edit
EditCommitResultvalue class onEditController- Backspace/Delete tests for editing vs navigation mode
Deprecated #
KeyboardHandlerclass — use theShortcuts/Actionspattern instead (seeworksheet_intents.dart)
Changed #
Worksheetwidget now usesShortcuts->Actions->Focuswidget tree instead ofFocus(onKeyEvent:)withKeyboardHandler- Destructive actions (
ClearCells,Cut,Paste,FillDown,FillRight) checkreadOnlyinisEnabled()as defense-in-depth - Cell-level actions (copy, cut, paste, clear, select-all) are disabled while the
editControlleris editing, so Ctrl+C/X/V/A and Backspace/Delete reach the text field for in-cell editing CellEditorOverlayusesTextFieldwithInputDecoration.collapsedfor proper cursor rendering, text selection, and double-click word selection- Parent double-tap handler suppressed while editing so the TextField's word-select gesture wins the gesture arena
- Pointer-down within the editing cell is passed through to the TextField for cursor repositioning instead of committing the edit
TilePainter.editingCellfield hides tile-rendered text for the cell being edited (avoids double rendering)
1.3.0 - 2025-02-02 #
Added #
WorksheetController.getCellScreenBounds()— returns screen-spaceRectfor a cell, accounting for zoom, scroll offset, and headersWorksheetController.ensureCellVisible()— simplified scroll-to-cell that uses the attached layoutWorksheetController.hasLayout/layoutSolver/headerWidth/headerHeight— public read access to the widget's internal layout stateWorksheetController.attachLayout()/detachLayout()— called by theWorksheetwidget to share its internalLayoutSolver
Fixed #
- Cell text disappearing on alternating rows after column resize — cell backgrounds straddling a tile boundary overflowed into adjacent tiles because
PictureRecordercullRectis only a hint; added hardclipRectto tile canvas - Deferred
TextPainterdisposal until afterPictureRecorder.endRecording()to prevent premature nativeParagraphresource release
Changed #
Worksheetwidget now attaches itsLayoutSolverand header dimensions to the controller after initialization- Simplified
_ensureSelectionVisibleinWorksheetto useensureCellVisible - Example app no longer creates a duplicate
LayoutSolver; usescontroller.getCellScreenBounds()instead - Updated GETTING_STARTED.md, COOKBOOK.md, API.md, and ARCHITECTURE.md to reflect the new API
1.2.0 - 2025-01-30 #
Added #
CellFormatclass with Excel-style format codes for cell display formatting- 16 built-in format presets (currency, percentage, date, scientific, fraction, etc.)
CellFormatTypeenum with 12 format categoriesCell.formatfield for per-cell formattingCell.displayValuegetter — uses format when presentCell.copyWithFormat()methodWorksheetData.getFormat()/setFormat()with backward-compatible defaultsSparseWorksheetDataformat storage with change events and batch supportDataChangeType.cellFormatevent type
Changed #
TilePainterandFrozenLayeruseCellFormatwhen rendering cell contentCell.isEmptyconsiders format field
Deprecated #
CellStyle.numberFormat— useCellFormatonCellinstead
1.1.0 - 2025-01-27 #
Added #
- Built-in keyboard navigation in Worksheet widget (arrow keys, Tab, Enter, Home/End, PageUp/Down, F2, Escape, Ctrl+A)
- 18 widget-level keyboard navigation tests
- Release process checklist in CLAUDE.md
Fixed #
- Selection and header layers now repaint on selection change (CustomPainter repaint listenable)
Changed #
- Simplified example/main.dart by removing manual keyboard handling code
- Updated COOKBOOK.md keyboard navigation section to reflect built-in support
1.0.1 - 2025-01-25 #
Added #
- Screenshot in README.md via golden test
- GitHub Actions CI workflow for automated testing
- Codecov integration for coverage reporting
- Roboto font bundled for consistent text rendering
Fixed #
- Resolved all dart analyzer warnings in lib/ and test/
- Fixed installation instructions to use pub.dev version
- Golden tests excluded from CI (platform-dependent font rendering)
Changed #
- README badges: pub.dev version, license, CI status, coverage
1.0.0 - 2025-01-25 #
Added #
- Example application with 50,000 rows of sample sales data
- Performance benchmarks for tile rendering (< 8ms target)
- Performance benchmarks for hit testing (< 100μs target)
- Scroll performance benchmarks
- Large dataset integration tests
- Memory leak tests
- Comprehensive documentation suite:
- ARCHITECTURE.md with rendering pipeline deep dive
- GETTING_STARTED.md with installation and basic usage
- COOKBOOK.md with practical recipes
- PERFORMANCE.md optimization guide
- THEMING.md customization guide
- TESTING.md testing patterns
- API.md quick reference
- Updated PLAN.md to reflect completed implementation
Changed #
- Version bumped to 1.0.0 for production release
0.9.0 - 2024-01-24 #
Added #
WorksheetWidget- Main public StatefulWidgetWorksheetController- Programmatic control aggregating sub-controllersWorksheetThemeData- Complete theming and styling supportWorksheetTheme- InheritedWidget for theme propagation- Complete public API exports in
worksheet.dart - Gesture handling integration
- Layer composition using Stack
0.8.0 - 2024-01-23 #
Added #
RenderLayer- Abstract interface for render layersSelectionLayer- Selection highlight paintingSelectionRenderer- Selection visual renderingHeaderLayer- Row and column header layerHeaderRenderer- A,B,C column and 1,2,3 row labelsFrozenLayer- Infrastructure for frozen panes (not fully wired)
0.7.0 - 2024-01-22 #
Added #
EditController- Cell editing orchestration with start/commit/cancel flowEditTriggerenum - Double-tap, keyboard, and typing triggersCellEditorOverlay- Floating text editor widget for cell editing
0.6.0 - 2024-01-21 #
Added #
SelectionController- Selection state machine with single/range/row/column modesHitTester- Coordinate resolution from screen to worksheet spaceHitTestResult- Types for cell, header, and resize handle hitsGestureHandler- Unified gesture processingKeyboardHandler- Arrow keys and keyboard shortcutsScaleHandler- Pinch-to-zoom gesture handling
0.5.0 - 2024-01-20 #
Added #
ZoomController- Zoom level management extending ValueNotifier- Support for 10%-400% zoom range (0.1 to 4.0)
zoomIn(),zoomOut(), andreset()methods- Zoom clamping and validation
0.4.0 - 2024-01-19 #
Added #
ScrollAnchor- Position preservation during zoomWorksheetScrollPhysics- Custom scroll momentum physicsViewportDelegate- Interface for viewport managementWorksheetViewport- TwoDimensionalScrollable integrationWorksheetScrollDelegate- Child management for 2D scrolling
0.3.0 - 2024-01-18 #
Added #
TileCoordinate- Tile grid position representationTileConfig- Configuration with 256px tiles, LRU cache settingsTile- Single cached tile with GPU-backedui.PictureTilePainter- Cell painting with level-of-detail (LOD) renderingTileCache- LRU eviction cache for tilesTileManager- Tile lifecycle orchestration
Performance #
- GPU-backed tile caching for smooth scrolling
- Level-of-detail rendering based on zoom level
- LRU cache eviction to manage memory
0.2.0 - 2024-01-17 #
Added #
WorksheetData- Abstract interface for worksheet data accessSparseWorksheetData- Map-based sparse storage implementationDataChangeEvent- Granular change events for reactive updatesSpanList- Cumulative row/column sizes with O(log n) lookupsLayoutSolver- Position to index conversionVisibleRangeCalculator- Viewport to CellRange queriesZoomTransformer- Zoom-aware coordinate math with ZoomBucket enum
Performance #
- O(log n) binary search for position lookups
- Memory-efficient sparse data storage
0.1.0 - 2024-01-16 #
Added #
- Initial project scaffolding
CellCoordinate- Immutable (row, col) address with Excel notation (A1, AA100)CellRange- Rectangular cell selection with normalization and contains()CellValue- Union type supporting text, number, boolean, formula, error, dateCellStyle- Font, color, alignment, and border stylingFreezeConfig- Configuration for frozen panes- Full test coverage for all core models
- CLAUDE.md development guide
- PLAN.md implementation plan
Technical #
- TDD workflow with tests written before implementation
- SOLID principles applied throughout
- Immutable models with proper equality/hashCode