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 .xlsx file from an InputStream.
factory
Excel.decodeBytes(List<int> data)
Decodes an .xlsx file from a byte list.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
parser ↔ Parser
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
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

Methods

appendRow(String sheet, List<CellValue?> row) → void
Appends row after the last filled row in sheet.
copy(String fromSheet, String toSheet) → void
Copies contents of fromSheet into toSheet.
delete(String sheet) → void
Deletes sheet if it exists and is not the last sheet.
encode() List<int>?
Encodes the workbook as .xlsx bytes.
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 source with target in sheet. 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") in sheet.
insertColumn(String sheet, int columnIndex) → void
Inserts an empty column at columnIndex in sheet.
insertRow(String sheet, int rowIndex) → void
Inserts an empty row at rowIndex in sheet.
insertRowIterables(String sheet, List<CellValue?> row, int rowIndex, {int startingColumn = 0, bool overwriteMergedCells = true}) → void
Inserts row values at rowIndex in sheet.
Links sheet1 to existingSheetObject so changes to one affect the other.
merge(String sheet, CellIndex start, CellIndex end, {CellValue? customValue}) → void
Merges cells from start to end in sheet.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeColumn(String sheet, int columnIndex) → void
Removes the column at columnIndex from sheet.
removeRow(String sheet, int rowIndex) → void
Removes the row at rowIndex from sheet.
rename(String oldSheetName, String newSheetName) → void
Renames oldSheetName to newSheetName.
save({String fileName = 'FlutterExcel.xlsx'}) List<int>?
Starts Saving the file. On Web
setDefaultSheet(String sheetName) bool
Sets sheetName as the default opening sheet. Returns true on success.
toString() String
A string representation of this object.
inherited
Breaks the link between sheet and any shared sheet object.
unMerge(String sheet, String unmergeCells) → void
Unmerges the given unmergeCells range (e.g. "A1:A2") in sheet.
updateCell(String sheet, CellIndex cellIndex, CellValue? value, {CellStyle? cellStyle}) → void
Updates a cell's value and optional style at cellIndex in sheet.

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 sheet contents to a clone of sheetObject.