spreadsheet library

Spreadsheets: Excel workbooks (.xlsx) and CSV files.

SpreadsheetView shows the sheet a SpreadsheetController has loaded, building only the cells on screen, with the file's column widths, frozen panes, merged cells, number formats, borders, conditional formatting and notes.

To read a workbook's cells without showing them, parse it with XlsxReader or CsvReader into a Workbook.

Classes

BoolValue
A boolean, shown as TRUE or FALSE.
BorderLine
One side's line: its style, and colour as 0xAARRGGBB (null for automatic, which is black on white paper).
CellBorders
The lines on a cell's four sides; null where there's none.
CellComment
A note on a cell (Excel's "comment"; a threaded comment shows as the thread's text, as older Excel shows it).
CellMatch
A single cell match from a SpreadsheetController's search.
CellRange
A rectangle of cells, zero-based and inclusive (A1:B2 is rows 0-1, columns 0-1).
CellStyle
The parts of a cell's formatting a reader shows.
CellValue
A cell's content.
CsvReader
Reads CSV text (RFC 4180) into a one-sheet Workbook.
DataBar
A bar across part of a cell's width, as conditional formatting draws it: fraction (0-1) of the width, in color (0xAARRGGBB).
DocumentController
What every format's controller does, so an app can build one toolbar, search bar and position display for all of them.
DocumentLocation
Where the reader is in a document: "page 3 of 12", "row 40 of 900".
DocumentSearchState
A search in a document: the query, how many times it occurs and which occurrence is current.
DocumentViewerStrings
The text the package's widgets show: messages, labels, tooltips and screen-reader descriptions. English by default.
DocumentViewerStringsScope
Gives the package's widgets below it strings instead of English.
DocumentViewerTheme
Colours the package's views use for search matches, as a ThemeExtension on the app's theme.
ErrorValue
An error result such as #DIV/0! or #N/A.
FormulaValue
A formula and the result Excel saved with it (cached; null when the file has none).
NumberFormat
An Excel number format code (ECMA-376 Part 1, §18.8.31), e.g. #,##0.00, 0%, m/d/yyyy or $#,##0_);[Red]($#,##0), and how a number looks under it.
NumberValue
A number. Dates and times are numbers too (days since the workbook's epoch, as Excel stores them); the cell's number format shows them as dates.
PositionKeys
Keys used in ReadingPosition maps, per reader.
SheetCell
One cell: its value, formatting and any data bar.
SheetLayout
How a sheet's rows and columns are sized, in the file's own units: column widths in characters of the default font's digit width (Excel's "8.43"), row heights in points.
SpreadsheetController
Loads an Excel workbook (.xlsx) or a CSV file for SpreadsheetView: its sheets (a CSV has one), the sheet on screen, zoom, search and scrolling.
SpreadsheetView
A spreadsheet grid built lazily (only the cells on screen exist), with the sheet's own column widths and row heights, hidden rows/columns left out, its frozen panes pinned along with the header row and row-number column, merged cells, and its text formatting. Also: a −/+ zoom pill, search highlights, row/column selection with Count/Sum/Avg and Copy, a cell's full value (with its formula, note and link) on tap. Cell borders, conditional formatting (fills, colours, data bars) and a note marker come from the file. Scrolls through the controller's verticalController/horizontalController. Serves Excel and CSV alike.
TextValue
A text value (a shared, inline or formula string, or CSV text).
Workbook
A spreadsheet as read from an .xlsx or CSV file: its sheets in workbook order, hidden ones included (a reader decides whether to show them).
Worksheet
One sheet of a Workbook: its cells, layout, merges, links and notes.
XlsxReader
Reads an .xlsx workbook (SpreadsheetML, ECMA-376 Part 1 §18) for display: sheet order and visibility, cell values (shared and inline strings, numbers, booleans, errors, formulas with their saved results), the formatting a reader shows (number format, bold, italic, solid fill with theme and indexed colours, cell borders), conditional formatting (see ConditionalRule for which rules), comments, and frozen panes.

Enums

BorderLineStyle
Excel's line styles. A reader draws the dashed and dotted ones solid; width is their weight in logical pixels.
DocumentFormat
A document type universal_document_viewer can read, and how files map to it.
DocumentLoadError
Why a document couldn't be opened.
DocumentStatus
Where a DocumentController is in its document's life.
DocumentUnit
What DocumentLocation.current and DocumentLocation.count count.
HorizontalAlignment
A cell's horizontal alignment, from <alignment horizontal>.
SheetVisibility
Whether a sheet's tab is shown, from <sheet state> in the workbook.
VerticalAlignment
A cell's vertical alignment, from <alignment vertical>.

Typedefs

CellAddress = ({int column, int row})
A zero-based cell position.
ReadingPosition = Map<String, Object?>
A reader's saved place in a document, as plain JSON-safe values.

Exceptions / Errors

XlsxFormatException
The file isn't a readable .xlsx.