Sheet class Core
Represents a single worksheet within an Excel workbook.
- Available extensions
Properties
- autoFilter → String?
-
The autofilter range as an
A1:D1-style string, ornullif none is set.no setterinherited -
autoFilterColumns
→ List<
FilterColumn> -
The applied per-column filter FilterColumn criteria, or an empty list
when the autofilter only shows dropdowns (or there is none).
no setterinherited
-
charts
→ List<
Chart> -
The charts on this sheet, both those added via
addChartand those read from an opened file. Read-only.no setterinherited -
columnPageBreaks
→ List<
int> -
The manual column page breaks: 0-based indices of columns that start a new
printed page, sorted ascending.
no setterinherited
-
comments
→ Map<
String, Comment> -
The cell comments (notes) on this sheet, keyed by cell reference (
"B2").no setterinherited -
conditionalFormats
→ List<
ConditionalFormat> -
The conditional-formatting rules on this sheet, those read from an opened
file first, then any added via the API, each carrying its
ConditionalFormat.range. Read rules are for inspection; they round-trip
untouched in the sheet envelope and are not re-emitted from this list.
no setterinherited
-
dataValidations
→ Map<
String, DataValidation> -
All data validations on this sheet, keyed by their
sqrefrange string (e.g."C2:C100"). Read-only; edit viasetDataValidation/removeDataValidation.no setterinherited - defaultColumnWidth → double?
-
The default column width, or
nullif not set.no setterinherited - defaultRowHeight → double?
-
The default row height, or
nullif not set.no setterinherited - frozenColumns → int
-
The number of leading columns currently frozen (
0if none).no setterinherited - frozenRows → int
-
The number of leading rows currently frozen (
0if none).no setterinherited -
getColumnAutoFits
→ Map<
int, bool> -
returns map of auto fit columns
no setterinherited
-
getColumnWidths
→ Map<
int, double> -
returns map of custom width columns
no setterinherited
-
getRowHeights
→ Map<
int, double> -
returns map of custom height rows
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
The header and footer settings for this sheet.
getter/setter pairinherited
-
hyperlinks
→ Map<
String, Hyperlink> -
All hyperlinks on this sheet, keyed by their cell/range reference
(e.g.
"A1"). Read-only; usesetHyperlink/removeHyperlinkto edit.no setterinherited -
images
→ List<
ExcelImage> -
All images on this sheet, in document order (those read from the file plus
any inserted via
insertImage). Read-only.no setterinherited - isProtected → bool
-
Whether this sheet is protected.
no setterinherited
- isRTL ↔ bool
-
returns
trueis this sheet isright-to-leftother-wisefalsegetter/setter pairinherited - maxColumns → int
-
returns count of
columnshaving data insheetno setterinherited - maxRows → int
-
returns count of
rowshaving data insheetno setterinherited - pageSetup ↔ PageSetup?
-
The page/print setup for this sheet (orientation, scaling, centering, what
to print, and margins), or
nullif none is set.getter/setter pairinherited -
pivotTables
→ List<
PivotTable> -
The pivot tables on this sheet, both those added via
addPivotTableand those read from an opened file. Read-only.no setterinherited - printArea → String?
-
The print area as a cleaned
A1:D10-style range (sheet qualifier and$markers stripped; multiple areas comma-separated), ornullif unset.no setterinherited - printTitleColumns → String?
-
The repeating title columns as a cleaned
A:A-style range, ornull.no setterinherited - printTitleRows → String?
-
The repeating title rows as a cleaned
1:1-style range, ornull.no setterinherited -
protectionAllowed
→ Set<
SheetProtectionOption> -
The actions permitted while this sheet is protected (read-only view).
no setterinherited
-
rowPageBreaks
→ List<
int> -
The manual row page breaks: 0-based indices of rows that start a new
printed page, sorted ascending.
no setterinherited
-
rows
→ List<
List< Data?> > -
returns
2-D dynamic Listof the sheet elementsno setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sheetName → String
-
return
SheetNameno setterinherited - showGridLines ↔ bool
-
Whether gridlines are shown in this sheet (default
true).getter/setter pairinherited - showRowColHeaders ↔ bool
-
Whether row and column headers are shown in this sheet (default
true).getter/setter pairinherited -
spannedItems
→ List<
String> -
returns List of Spanned Cells as
no setterinherited
-
sparklineGroups
→ List<
SparklineGroup> -
The sparkline groups on this sheet, those read from an opened file first,
then any added via the API. Read groups are for inspection; they round-trip
untouched in the worksheet
extLst.no setterinherited - splitX → int
-
The horizontal split position in twips (1/20 pt), or
0when not split.no setterinherited - splitY → int
-
The vertical split position in twips (1/20 pt), or
0when not split.no setterinherited - tabColor ↔ ExcelColor?
-
The colour of this sheet's tab, or
nullif none is set.getter/setter pairinherited -
tables
→ List<
ExcelTable> -
The Excel tables (ListObjects) on this sheet (read from the file plus any
added via
addTable). Read-only; edit viaaddTable/removeTable.no setterinherited - visibility ↔ SheetVisibility
-
Whether this sheet's tab is visible, hidden, or very hidden.
getter/setter pairinherited
- zoom ↔ int?
-
The zoom level as a percentage (Excel supports 10-400), or
nullfor the default. Non-positive values are treated as unset.getter/setter pairinherited
Methods
-
addChart(
Chart chart) → void -
Adds
chartto the sheet. It is drawn through the sheet's drawing part on save, alongside any images or existing charts.inherited -
addConditionalFormat(
CellIndex start, CellIndex end, ConditionalFormat format) → void -
Adds a conditional-formatting
formatover the range fromstarttoend. Multiple rules may target the same or overlapping ranges.inherited -
addPivotTable(
PivotTable pivot) → void -
Adds a PivotTable summarising a worksheet range.
inherited
-
addSparkline(
{required String location, required String dataRange, SparklineType type = SparklineType.line, ExcelColor? color}) → void -
Convenience for a single sparkline: draws a
typesparkline ofdataRangein the celllocation(bothA1-style strings). For several sparklines sharing one style, preferaddSparklineGroup.inherited -
addSparklineGroup(
SparklineGroup group) → void -
Adds a SparklineGroup (a set of sparklines sharing one type and colour).
inherited
-
addTable(
ExcelTable table) → void -
Adds an Excel table (ListObject) over a cell range.
inherited
-
appendRow(
List< CellValue?> row) → void -
Appends
rowiterables just post the last filledrowIndex. -
cell(
CellIndex cellIndex) → Data -
returns the
DataObjectat position ofcellIndexinherited -
clearPageBreaks(
) → void -
Removes all manual page breaks from this sheet.
inherited
-
clearRow(
int rowIndex) → bool -
returns
trueif the contents are successfullyclearedelsefalse. -
columnOutlineLevel(
int columnIndex) → int -
The outline (grouping) level of
columnIndex,0when not grouped.inherited -
evaluate(
CellIndex index) → CellValue? Core -
Evaluates the formula at
indexand returns the computed CellValue.inherited -
findAndReplace(
Pattern source, String target, {int first = -1, int startingRow = -1, int endingRow = -1, int startingColumn = -1, int endingColumn = -1}) → int -
Returns the
countof replacedsourcewithtarget -
freezePanes(
{int rows = 0, int columns = 0}) → void -
Freezes the top
rowsrows and leftcolumnscolumns so they stay in view while scrolling. Pass both as0(or callunfreezePanes) to clear.inherited -
getColumnAutoFit(
int columnIndex) → bool -
returns auto fit state of column index
inherited
-
getColumnWidth(
int columnIndex) → double -
returns width of column index
inherited
-
getComment(
CellIndex index) → Comment? -
The comment on the cell at
index, ornullif there is none.inherited -
getDataValidation(
CellIndex start, {CellIndex? end}) → DataValidation? -
Returns the data validation keyed to exactly the range from
starttoend(or the single cellstart), ornullif there is none.inherited -
getHyperlink(
CellIndex cellIndex) → Hyperlink? -
Returns the hyperlink on the cell at
cellIndex, ornullif there is none keyed to that exact reference.inherited -
getRowHeight(
int rowIndex) → double -
returns height of row index
inherited
-
getTable(
String name) → ExcelTable? -
Returns the table named
name(case-insensitive), ornullif there is none.inherited -
groupColumns(
int fromColumn, int toColumn, {bool collapsed = false}) → void -
Groups columns
fromColumn-toColumn(0-based, inclusive) into a collapsible outline. Each call nests one level deeper (max 7). Whencollapsedis true the columns are hidden and the summary column just to the right is flagged collapsed.inherited -
groupRows(
int fromRow, int toRow, {bool collapsed = false}) → void -
Groups rows
fromRow-toRow(0-based, inclusive) into a collapsible outline. Each call nests one level deeper (Excel's "Group", max 7). Whencollapsedis true the rows are hidden and the summary row just below the group is flagged collapsed (Excel's default "summary below" layout).inherited -
insertColumn(
int columnIndex) → void -
Inserts an empty
columnin sheet at position =columnIndex.inherited -
insertColumnPageBreak(
int columnIndex) → void -
Inserts a manual page break to the left of
columnIndex(0-based) so that column begins a new printed page. Indices<= 0are ignored.inherited -
insertImage(
List< int> bytes, {required CellIndex anchor, int? width, int? height}) → void -
Inserts
bytesas a picture with its top-left corner anchored atanchor.inherited -
insertRow(
int rowIndex) → void -
Inserts an empty row in
sheetat position =rowIndex.inherited -
insertRowIterables(
List< CellValue?> row, int rowIndex, {int startingColumn = 0, bool overwriteMergedCells = true}) → void -
Inserts
rowvalues atrowIndex. -
insertRowPageBreak(
int rowIndex) → void -
Inserts a manual page break above
rowIndex(0-based) so that row begins a new printed page. Indices<= 0are ignored; there is no page above the first row.inherited -
isColumnHidden(
int columnIndex) → bool -
Whether
columnIndexis hidden.inherited -
isRowHidden(
int rowIndex) → bool -
Whether
rowIndexis hidden.inherited -
merge(
CellIndex start, CellIndex end, {CellValue? customValue}) → void -
Merges the cells starting from
starttoend.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
protect(
{String? password, Set< SheetProtectionOption> allow = const {}}) → void -
Protects the sheet, locking every action except selecting cells and any
listed in
allow.inherited -
removeAutoFilter(
) → void -
Removes the autofilter from this sheet.
inherited
-
removeColumn(
int columnIndex) → void -
If
sheetexists andcolumnIndex < maxColumnsthen it removes column at index =columnIndexinherited -
removeColumnPageBreak(
int columnIndex) → void -
Removes a previously inserted column page break (no-op if absent).
inherited
-
removeComment(
CellIndex index) → void -
Removes the comment from the cell at
index(no-op if there is none).inherited -
removeDataValidation(
CellIndex start, {CellIndex? end}) → DataValidation? -
Removes and returns the data validation keyed to exactly the range from
starttoend(or the single cellstart).inherited -
removeHyperlink(
CellIndex cellIndex) → Hyperlink? -
Removes and returns any hyperlink on the cell at
cellIndex.inherited -
removePrintArea(
) → void -
Removes the print area (no-op if none is set).
inherited
-
removePrintTitles(
) → void -
Removes the repeating print titles (no-op if none are set).
inherited
-
removeRow(
int rowIndex) → void -
If
sheetexists androwIndex < maxRowsthen it removes row at index =rowIndexinherited -
removeRowPageBreak(
int rowIndex) → void -
Removes a previously inserted row page break (no-op if absent).
inherited
-
removeTable(
String name) → bool -
Removes the table named
name(case-insensitive). Returnstrueif a table was removed.inherited -
row(
int rowIndex) → List< Data?> -
returns row at index =
rowIndexinherited -
rowOutlineLevel(
int rowIndex) → int -
The outline (grouping) level of
rowIndex,0when not grouped, up to 7.inherited -
selectRange(
CellIndex start, {CellIndex? end}) → List< List< Data?> ?> -
returns
2-D dynamic Listof the sheet cell data in that range. -
selectRangeValues(
CellIndex start, {CellIndex? end}) → List< List?> -
returns
2-D dynamic Listof the sheet elements in that range. -
selectRangeValuesWithString(
String range) → List< List?> -
returns
2-D dynamic Listof the sheet elements in that range. -
selectRangeWithString(
String range) → List< List< Data?> ?> -
returns
2-D dynamic Listof the sheet cell data in that range. -
setAutoFilter(
CellIndex from, CellIndex to, {List< FilterColumn> ? criteria}) → void -
Adds filter dropdowns over the header range from
fromtoto(e.g. the header row of a table). Replaces any existing autofilter.inherited -
setColumnAutoFit(
int columnIndex) → void -
Set Column AutoFit
inherited
-
setColumnHidden(
int columnIndex, ) → void -
Shows or hides
columnIndex.inherited -
setColumnWidth(
int columnIndex, double columnWidth) → void -
Set Column Width
inherited
-
setComment(
CellIndex index, Comment comment) → void -
Attaches
commentto the cell atindex, replacing any existing one.inherited -
setDataValidation(
CellIndex start, DataValidation validation, {CellIndex? end}) → void -
Applies
validationto the range fromstarttoend(or just the single cellstartwhenendis omitted).inherited -
setDefaultColumnWidth(
[double columnWidth = _excelDefaultColumnWidth]) → void -
Set the default column width.
inherited
-
setDefaultRowHeight(
[double rowHeight = _excelDefaultRowHeight]) → void -
Set the default row height.
inherited
-
setHyperlink(
CellIndex cellIndex, Hyperlink link) → void -
Attaches
linkto the cell atcellIndex.inherited -
setMergedCellStyle(
CellIndex start, CellStyle mergedCellStyle) → void -
Sets the cellStyle of the merged cells.
inherited
-
setPrintArea(
CellIndex from, CellIndex to) → void -
Restricts printing to the rectangle from
fromtoto. Stored as the built-in_xlnm.Print_Areadefined name scoped to this sheet.inherited -
setPrintTitleColumns(
int fromColumn, int toColumn) → void -
Repeats columns
fromColumn-toColumn(0-based, inclusive) at the left of every printed page. Preserves any repeating rows already set.inherited -
setPrintTitleRows(
int fromRow, int toRow) → void -
Repeats rows
fromRow-toRow(0-based, inclusive) at the top of every printed page. Preserves any repeating columns already set.inherited -
setRowHeight(
int rowIndex, double rowHeight) → void -
Set Row Height
inherited
-
setRowHidden(
int rowIndex, ) → void -
Shows or hides
rowIndex.inherited -
splitPanes(
{int xSplit = 0, int ySplit = 0, String? topLeftCell}) → void -
Splits the sheet into independently-scrolling panes at
xSplittwips from the left and/orySplittwips from the top (1 twip = 1/20 pt). UnlikefreezePanes, split panes are draggable and scroll independently.inherited -
toCsv(
{CsvConfig? config, bool formulasAsText = false}) → String - Serialises this sheet's used cell range to CSV text.
-
toString(
) → String -
A string representation of this object.
inherited
-
unfreezePanes(
) → void -
Removes any frozen or split panes from this sheet.
inherited
-
ungroupColumns(
int fromColumn, int toColumn) → void -
Removes one outline level from columns
fromColumn-toColumnand un-hides them.inherited -
ungroupRows(
int fromRow, int toRow) → void -
Removes one outline level from rows
fromRow-toRowand un-hides them.inherited -
unMerge(
String unmergeCells) → void -
unMerge the merged cells.
inherited
-
unprotect(
) → void -
Removes protection from this sheet.
inherited
-
updateCell(
CellIndex cellIndex, CellValue? value, {CellStyle? cellStyle}) → void -
Updates the contents of
sheetof thecellIndex: CellIndex.indexByColumnRow(0, 0);where indexing starts from 0
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited