Excel class Core
The main class for reading, creating, and editing Excel .xlsx files.
Constructors
- Excel.createExcel()
-
Creates a new blank Excel workbook with a default sheet.
factory
- Excel.decodeBuffer(InputStream input)
-
Decodes an
.xlsxfile from anInputStream.factory -
Excel.decodeBytes(List<
int> data) -
Decodes an
.xlsxfile from a byte list.factory
Properties
-
definedNames
→ List<
DefinedName> -
The workbook's defined names (named ranges/formulas).
no setter
- formula → FormulaApi
-
The formula subsystem — register custom functions for
Sheet.evaluate.latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
- isWorkbookProtected → bool
-
Whether the workbook is protected (its structure and/or windows locked).
no setter
- parser ↔ Parser
-
The internal parser that decoded this workbook. Exposed for advanced use;
not part of the supported public surface and may change between releases.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sheetOrder
→ List<
String> -
The sheet names in their current tab order.
no setter
-
sheets
→ Map<
String, Sheet> -
Returns all sheets as a map of sheet names to Sheet objects.
no setter
-
tables
→ Map<
String, Sheet> -
Returns all sheets as a map of sheet names to Sheet objects.
no setter
- workbookStructureLocked → bool
-
Whether the workbook structure is locked — sheets cannot be added,
deleted, renamed, moved, hidden, or unhidden in Excel.
no setter
- workbookWindowsLocked → bool
-
Whether the workbook windows are locked to their size and position.
no setter
Methods
-
appendRow(
String sheet, List< CellValue?> row) → void -
Appends
rowafter the last filled row insheet. -
copy(
String fromSheet, String toSheet) → void -
Copies contents of
fromSheetintotoSheet. -
delete(
String sheet) → void -
Deletes
sheetif it exists and is not the last sheet. -
encode(
) → List< int> ? -
Encodes the workbook as
.xlsxbytes. -
findAndReplace(
String sheet, Pattern source, dynamic target, {int first = -1, int startingRow = -1, int endingRow = -1, int startingColumn = -1, int endingColumn = -1}) → int -
Replaces occurrences of
sourcewithtargetinsheet. Returns the count of replacements. -
getDefaultSheet(
) → String? - Returns the name of the default sheet.
-
getMergedCells(
String sheet) → List< String> -
Returns a list of merged cell ranges (e.g.
"A1:B2") insheet. -
insertColumn(
String sheet, int columnIndex) → void -
Inserts an empty column at
columnIndexinsheet. -
insertRow(
String sheet, int rowIndex) → void -
Inserts an empty row at
rowIndexinsheet. -
insertRowIterables(
String sheet, List< CellValue?> row, int rowIndex, {int startingColumn = 0, bool overwriteMergedCells = true}) → void -
Inserts
rowvalues atrowIndexinsheet. -
link(
String sheet1, Sheet existingSheetObject) → void -
Links
sheet1toexistingSheetObjectso changes to one affect the other. -
merge(
String sheet, CellIndex start, CellIndex end, {CellValue? customValue}) → void -
Merges cells from
starttoendinsheet. -
moveSheet(
String sheetName, {required int toIndex}) → void -
Moves
sheetNameto positiontoIndexin the tab order (0 = first). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
protectWorkbook(
{String? password, bool lockStructure = true, bool lockWindows = false}) → void -
Protects the workbook, locking its
lockStructure(sheet add/delete/ rename/move/hide) and/orlockWindows(window size & position). -
recalculate(
) → void -
Recomputes every formula cell in the workbook and stores each result as the
formula's cached value (its
<v>), so a saved file shows results without the spreadsheet app having to recalculate. -
removeColumn(
String sheet, int columnIndex) → void -
Removes the column at
columnIndexfromsheet. -
removeDefinedName(
String name, {int? localSheetId}) → bool -
Removes the defined
namein the given scope (localSheetId/ global). Returns whether a name was removed. -
removeRow(
String sheet, int rowIndex) → void -
Removes the row at
rowIndexfromsheet. -
rename(
String oldSheetName, String newSheetName) → void -
Renames
oldSheetNametonewSheetName. -
save(
{String fileName = 'FlutterExcel.xlsx'}) → List< int> ? -
Starts Saving the file.
On Web -
setDefaultSheet(
String sheetName) → bool -
Sets
sheetNameas the default opening sheet. Returnstrueon success. -
setDefinedName(
String name, String refersTo, {int? localSheetId, String? comment, }) → void -
Defines (or replaces) a named range/formula
namethat refers torefersTo(e.g."'Sheet1'!\$A\$1:\$B\$2"). -
toString(
) → String -
A string representation of this object.
inherited
-
unLink(
String sheet) → void -
Breaks the link between
sheetand any shared sheet object. -
unMerge(
String sheet, String unmergeCells) → void -
Unmerges the given
unmergeCellsrange (e.g."A1:A2") insheet. -
unprotectWorkbook(
) → void - Removes workbook protection.
-
updateCell(
String sheet, CellIndex cellIndex, CellValue? value, {CellStyle? cellStyle}) → void -
Updates a cell's value and optional style at
cellIndexinsheet.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String sheet) → Sheet -
Returns the Sheet for
sheet, creating it if it doesn't exist. -
operator []=(
String sheet, Sheet sheetObject) → void -
Sets
sheetcontents to a clone ofsheetObject.