Published 2025-10-03
| Format | Read | Write | Styles |
|---|---|---|---|
| ods | x | ||
| xlsx | x | * | x |
| xls | |||
| csv | x | x | |
| tsv | x | x |

// open a spreadsheet (which is a collection of `Sheet` objects)
final Spreadsheet spreadsheet = await Spreadsheet(File('test.ods')).read();
// get the first sheet (don't care about its name)
final Sheet sheet = spreadsheet.getFirstSheet();
// get a specific sheet
final Sheet sheet = spreadsheet.getSheet('Sheet1');
// get sheet names
print(spreadsheet.getSheets());
// set a cell value at row 2, column 3, to value 4 (int value 4 is converted to string internally)
sheet.setCell(2, 3, 4);
// cell is always a string
final String cell = sheet.getCell(2, 3);
// don't forget to look at tests/index_test.dart for the workings of accessing cells
// by using indexed rows and columns, for example when the first row contains
// filenames, and the first column shop id's, it is easy to retrieve a specific cell by
// using something with a meaning instead of hard integer indexes.
final String shopid = '0001';
final String kaartje = 'roomboter.pdf';
final int verdubbeling = sheet.getCell(filiaalnummer, kaartje).toInt();
| | kaas.pdf | roomboter.pdf | brood.pdf |
| 0001 | 1 | 0 | 2 |
| 0002 | 3 | 2 | 1 |
| 0003 | 1 | 0 | 2 |
so sheet.getCell('0002', 'roomboter.pdf') returns '2'.
With the pkg_local_services package, it is possible to create ODS or XLSX files.
See the file /test/create_test.dart.
Sheet::doRemoveRowAt.Sheet::doInsertColumnAt.tsv with utf-8 encoding first, if it fails, try to read it with latin1 encoding.flutter-test package, changed to dart test.RangeError (index) to RangeError (length) (caused by SDK update?).Spreadsheet.fromByData.tp_grizzly_io dependency (project is dead).csv.dart from tp_grizzly_io.toString to Sheet.align property to Style.csv text separator.GrizzlyIO text separators set from double-quote to escape so reading of cells with quotes does not throw anymore.async constructs.csv with tabs, we set 'escape' as cell delimiter.csv with tabs when all else fails.await unawaited futures.unawaited.readSync and writeSync for synchronous reading and writing (duh...).grizzly_io from 3.0.1 to 4.0.0 and moved it to tp_grizzly_io.csv files with ; separator.ods or xlsx.README.md._doConvertSpecialCharacters on each cell update.RangeError exceptions when targeting rows/columns/cells that are out of range instead of trying to be nice and return an empty value (that way you would not know you did something wrong().Spreadsheet and Sheet, removed all sheet name references.Spreadsheet to Sheet.Spreadsheet::write now returns a list of output files.csv files, when no data was read, try ; as field separator.resolveSpans to read function to control the copying of spanned cell values._applySpans function to OdsDecoder and XlsxDecoder.none to FFFFFFFF.export to html.Spreadsheet.fromCsvString factory constructor.Spreadsheet.fromTsvString factory constructor.reading.print statements for logging.doRemoveRowsWhere.sheet selection to export and write.export now returns the File.export to preserve leading zero's when converting to ods or xlsx.export.xlsx line 414, apply default style when not present on xml tag.finals due to new linter rules.table.findElements('table:table-row'); to table.findAllElements('table:table-row');, so now fixed headers are read.tp_excel dependency.doPivot() function to rotate (pivot) a table (including it's styles).