An Excel library for Dart
Read, create, edit and style Microsoft Excel .xlsx spreadsheets from Dart, and read legacy .xls workbooks. No native dependencies, no Office install, no server round trip.
Install#
dart pub add excel_plusimport 'package:excel_plus/excel_plus.dart';A first example#
final excel = Excel.createExcel();
final sheet = excel['Sheet1'];
sheet.updateCell(CellIndex.indexByString('A1'), TextCellValue('Product'));
sheet.updateCell(CellIndex.indexByString('B1'), TextCellValue('Price'));
sheet.updateCell(CellIndex.indexByString('A2'), TextCellValue('Notebook'));
sheet.updateCell(CellIndex.indexByString('B2'), DoubleCellValue(12.50));
File('report.xlsx').writeAsBytesSync(excel.save()!);Guides#
- Read a fileOpen an .xlsx file and walk its rows and cells.
- Create a fileBuild a workbook from scratch and save it.
- Edit a fileOpen a template, change cells, write it back.
- Cell stylesFonts, colours, fills, borders, alignment and merges.
- Number formatsCurrency, percentages, dates and custom codes.
- FormulasWrite formulas, evaluate them, recalculate a workbook.
- CSVConvert between spreadsheets and CSV or TSV.
- Legacy .xlsRead old Excel 97-2003 binary workbooks.
- Large filesHandle workbooks with millions of cells.
What it supports#
- Reading, creating and editing
.xlsx, plus reading legacy.xls(Excel 97-2003) - All cell types: text, integers, doubles, booleans, dates, times and formulas
- Fonts, fills, gradients, borders, alignment, rotation, text wrapping and merged ranges
- Built in and custom number formats
- Around 160 formula functions, with evaluation and incremental recalculation
- Charts, sparklines, pivot tables, conditional formatting, data validation and autofilters
- Hyperlinks, freeze panes, cell comments, images and Excel tables
- CSV and TSV import and export
Where it runs#
Pure Dart, so it runs anywhere Dart does: the Dart VM, compiled executables, server code, mobile and desktop apps, and the browser through both JavaScript and WebAssembly. There is no dependency on a native Excel library or a headless Office process.