bcell 1.1.0 copy "bcell: ^1.1.0" to clipboard
bcell: ^1.1.0 copied to clipboard

A Flutter data-grid widget with a pluto_grid-shaped API and spreadsheet features: a formula engine, multi-sheet workbooks, charts, pivot tables, and CSV/XLSX/PDF import-export.

1.1.0 #

Feature release: charts, pivot tables, workbook security, and styling options on top of 1.0.0 — all additive, no breaking API changes.

  • Charts — BCellChart companion widget (line / bar / pie via fl_chart) that plots the grid's filtered rows through evaluated formula values and redraws live on edits, sorts, and filters.
  • Pivot tables — bcell_pivot.dart aggregation plugin with a toGrid() helper that renders the pivot result as a regular BCellGrid.
  • Shared workbook — bcell_workbook_share.dart collaboration plumbing.
  • Workbook file encryption — toEncryptedBytes / decryptWorkbook / loadEncryptedBytes (AES-256-GCM, PBKDF2-HMAC-SHA256 with hardened iteration bounds). Wrong passwords and tampered files fail with BCellDecryptException, never garbage data.
  • Version history — saveVersion / versions / restoreVersion / removeVersion snapshots on the workbook (in-memory, JSON-based).
  • Sheet-protection password — SHA-256 hashed, persisted in workbook JSON.
  • Number-format codes now persist through the workbook JSON round-trip.
  • Styling — BCellGridStyleConfig gains cell padding, header sort-icon, and fill-handle (fillHandleSize / fillHandleColor / fillHandleBorderColor) options, all theme-resolved like the existing style fields.
  • Docs — live Widgetbook demo linked from the README; pluto_grid LICENSE attribution added.
  • Performance — profile-mode scroll baselines re-verified on the expanded feature set (all three render paths stay well under the 8 ms frame-build budget); layout regression guard added for auto-size, frozen, colspan, rowspan, and hidden-column sizing.
  • Dependency: pointycastle ^4.0.0.

1.0.0 #

First stable release. BCell grows from the minimal 0.0.1 data grid into a spreadsheet-capable widget: a formula engine, a multi-sheet workbook, a full import/export surface, and a large set of Excel-style cell, column, and selection features — all still built on the flat BCellGridStateManager and virtualized rendering, guarded by a 10k-row performance regression test.

Column types & formatting #

  • Date columns — BCellColumnType.date({format}) hold a DateTime, display yyyy-MM-dd (or a custom formatter), edit via a native date picker, and coerce ISO strings / Excel date serials on import and paste.
  • Number format codes — BCellColumnType.number(format: '#,##0.00' | '0%' | '$#,##0.00' | '000') apply display grouping/decimals/percent/prefix while cells stay raw numbers, so sort and export are unaffected.
  • Custom cell renderer — BCellColumn(renderer:) draws any widget in place of the default cell text.
  • Conditional formatting — BCellColumn(cellStyle:) colors a cell by its value, plus BCellConditionalFormat.colorScale/dataBar/iconSet(...) renderers for color scales, data bars, and threshold icon sets.
  • Rich text — a cell can hold a BCellRichText([BCellTextRun(...)]) with bold/italic/underline/color runs (via BCellRichText.column().toRenderer()); exports flatten to plain text automatically.
  • Hyperlink cells — BCellHyperlink.column(onTap:).toRenderer() renders styled, tappable, accessible link text (no launcher dependency).
  • Cell notes — setNote/noteFor/hasNote/clearNotes.
  • Merge cells — BCellValue(colspan:, rowspan:) (display-only; colspan stays on the virtualized path, rowspan switches to a non-virtualized body).
  • Banded rows — BCellGridStyleConfig(oddRowColor:) zebra striping.
  • More style knobs — BCellGridStyleConfig gains defaultColumnTitlePadding, defaultCellPadding, iconSize, iconColor (pluto_grid names), and fillHandleSize/fillHandleColor/fillHandleBorderColor for the drag-fill handle; defaults are unchanged (the handle outline now theme-resolves to colorScheme.surface instead of hardcoded white).
  • Per-row height — BCellRow(height:) with virtualization preserved.

Columns & selection #

  • Freeze columns — BCellColumn(frozen: BCellColumnFrozen.start | .end) pins a column left/right with synced vertical scroll across sections.
  • Column reorder — moveColumn(from, to) plus header drag-to-reorder and accessible "Move left/right" actions.
  • Range/multi selection — anchor+focus range with Shift+click/arrow, extendSelectionTo/isInRange/selectedCells/rangeAsTsv, range copy / clear / fill, and a drag-fill handle.
  • Fill — fillDown (Ctrl+D), fillRight (Ctrl+R), fillSeriesDown() (series/ auto fill), flashFillDown() (flash fill by inferred transform).
  • Checkbox row selection — setRowChecked/toggleRowChecked/ setAllRowsChecked/checkedRows/isAllChecked/isAnyChecked.
  • Clipboard — copySelectionToClipboard/cutSelectionToClipboard/ pasteFromClipboard (TSV block paste, anchored and clipped).
  • Data validation — BCellColumn(validator:) enforced centrally in changeCellValue (also guards paste/fill), with an onInvalid callback.
  • Undo/redo (undo/redo/canUndo/canRedo), find (find('q')), and go-to (goToCell/goToRow).
  • Read-only mode — BCellGrid(mode: BCellGridMode.readOnly) / setGridMode(...) blocks every edit and structural row change.

Formula engine #

  • = formulas evaluate on display, sort, and export, with error results (#DIV/0!/#NAME?/#CIRC!/#NUM!/#REF!/#VALUE!/#N/A) and a cycle guard; results memoized per notification. Formula cells never leak a live =... into CSV.
  • A1 refs and A1:B2 ranges; arithmetic, comparison, & concat, string literals.
  • Function library: Math/Trig, Statistical, Financial (PMT/FV/PV/NPV/IRR), Lookup (VLOOKUP/HLOOKUP/INDEX/MATCH), Date & Time, Information, Logical, and Text categories.
  • Named ranges — defineName/removeName/clearNames/namedRange/ definedNames.
  • Structured references — enableStructuredRefs() for [Column] and decorative Table[Column] whole-column refs, live over displayed rows.

Import / export #

  • Exports — CSV, TSV, HTML, XML, Markdown, JSON, PDF (toPdf, dep: pdf; selectionOnly print area), and XLSX (toXlsx, dep: excel). Markup exports escape every cell value and title.
  • Imports — importTsv/importCsv (RFC 4180)/importHtml/importMarkdown/ importJson/importXlsx, mapping onto visible columns and coercing to each column type.

Workbook & infrastructure #

  • Multi-sheet workbook — BCellWorkbook (ordered BCellSheets + active sheet) with add/remove/rename/select/move, per-sheet tab color, protect, and hidden flags; BCellSheetTabBar (tab strip with drag-to-reorder and accessible move actions) and BCellWorkbookView.
  • Sheet-protection password — optional password: on BCellWorkbook.setProtected; unprotecting a password-protected sheet requires the matching password. Only a SHA-256 hash is stored and persisted in the workbook JSON, never the plaintext.
  • Workbook persistence — BCellWorkbook.toJson() / BCellWorkbook.fromJson() round-trip sheets, flags, column definitions (incl. number-format codes), and row data; loadJson() loads a map into an existing workbook in place.
  • Version history — saveVersion() / versions / restoreVersion() / removeVersion() / clearVersions(): in-memory named, timestamped workbook snapshots built on the JSON persistence, restorable in place.
  • Encrypted workbook file — toEncryptedBytes(password) seals the workbook JSON into an authenticated AES-256-GCM blob (PBKDF2-HMAC-SHA256 key derivation, random per-file salt and nonce); decryptWorkbook() / loadEncryptedBytes() open it, throwing BCellDecryptException on a wrong password or tampered bytes. Backed by pointycastle.
  • Shared-workbook merge — mergeChanges(base:, theirs:) folds another copy's edits into the workbook via a three-way, cell-level merge over toJson() snapshots; cells both copies changed differently keep the local value and are reported as BCellMergeConflicts. BCellWorkbookView now rebuilds its grid after any in-place load (loadJson/restoreVersion/ loadEncryptedBytes/mergeChanges), fixing stale rows when the active index was unchanged.
  • Event bus — BCellGridEventManager (addEvent/listener/stream) on a broadcast stream, allocated lazily.
  • Font scope — BCellFontController + BCellFontScope (InheritedNotifier) re-font every BCell widget under one controller live.
  • Charts — BCellChart(stateManager, type: BCellChartType.line/.bar/.pie, categoryField:, valueFields:), a companion widget that plots the grid's filtered rows (formula-evaluated) and re-draws live. Backed by fl_chart.
  • Pivot tables — stateManager.pivot(rowField:, columnField:, valueField:, aggregate: BCellPivotAgg.sum/count/average/min/max) aggregates the filtered rows into a rows × columns matrix (value/rowTotal/columnTotal/ grandTotal); totals re-aggregate the raw numbers. toGrid() renders the result into BCellGrid columns+rows. Single row/column field.

0.0.1 #

Initial release — a minimal data grid with a pluto_grid-shaped API.

  • BCellGrid widget: columns, rows, onLoaded, onChanged, onSelected, onSorted, configuration.
  • Models: BCellColumn (width, minWidth, readOnly, suppressedAutoSize), BCellColumnType.text()/.number(), BCellRow, BCellValue.
  • BCellGridStateManager (ChangeNotifier): cell editing (changeCellValue), selection (setCurrentCell/setEditing on a dedicated selection ValueNotifier, currentRow/currentRowIdx), sort cycle (toggleSortColumn, type-aware, restores insertion order), column resize (normal/pushAndPull/none), row ops (insertRows/prependRows/appendRows/removeRows/removeCurrentRow), column hiding (hideColumn/visibleColumns), row filtering (setFilter, sourceRows), paging (setPageSize/setPage/totalPage), keyboard navigation core (moveCurrentCell with BCellMoveDirection).
  • Keyboard support in BCellGrid: arrows/Tab move the selection, Enter/F2 edits, Escape cancels an edit without committing.
  • BCellPagination plugin widget: ready-made pager driven by the state manager (same shape as pluto_grid's PlutoPagination).
  • Inline tap-to-edit cells; number columns validate input.
  • Responsive column auto-sizing: BCellAutoSizeMode.equal/.scale, per-column opt-out.
  • CSV export (toCsv) with RFC 4180 quoting and opt-in formula-injection sanitizing.
  • Material 3 theme-aware styling; all colors/text styles overridable via BCellGridStyleConfig.
  • Performance: virtualized rows, cached list views, cell position lookup via back-references, selection changes rebuild only cells; guarded by a 10k-row regression test.
0
likes
160
points
93
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter data-grid widget with a pluto_grid-shaped API and spreadsheet features: a formula engine, multi-sheet workbooks, charts, pivot tables, and CSV/XLSX/PDF import-export.

Homepage
Repository (GitHub)
View/report issues

Topics

#grid #spreadsheet #table #widget #formula

License

MIT (license)

Dependencies

crypto, excel, fl_chart, flutter, pdf, pointycastle

More

Packages that depend on bcell