EditableTableController class

Inheritance

Constructors

EditableTableController({required List<EditableColumn> columns, List<EditableRow>? rows, int historyLimit = 200})

Properties

canRedo bool
no setter
canUndo bool
no setter
colCount int
no setter
columnOrder List<int>
The current visual order as a list of LOGICAL column indices.
no setter
columns List<EditableColumn>
final
draft String
no setter
editing bool
no setter
flash String?
no setter
hasClipboard bool
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
historyLimit int
final
invalidCount int
Count of required-but-empty (or otherwise invalid) cells across the grid.
no setter
rowCount int
no setter
rows List<EditableRow>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selection CellRef
no setter
sortColumn int?
no setter
sortDir SortDir
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addRow() → void
beginEdit([String? initial]) → void
blankRow() EditableRow
A fresh blank row honouring each column's EditableColumn.blankValue.
cancelEdit() → void
cellsAsTsv(Iterable<CellRef> cells) String
A rectangle covering cells; cells inside the bounding box but not in the set are emitted as empty fields, so the block keeps its shape on paste.
cellValue(int r, int c) String
columnAt(int visual) EditableColumn
The column shown at visual position visual.
columnTotal(EditableColumn column) double
Sum of a numeric column's parsed values (resolves computed columns).
commit({int dr = 0, int dc = 0, bool move = false, bool grow = true}) → void
Atomic commit: format-if-numeric, write the draft, and (when move) navigate — auto-growing a row past the end (unless grow is false) — all in one history step, so the typed value can never be clobbered by a follow-up update.
copyCell({bool cut = false}) → void
copyCellsToClipboard(Iterable<CellRef> cells) Future<bool>
Copy a cell rectangle to the system clipboard as TSV.
copyRowsToClipboard(Iterable<int> rowIndices, {bool includeHeader = false}) Future<int>
Copy whole rows to the system clipboard as TSV. Returns rows written.
copySelectionToClipboard() Future<void>
Convenience: copy the current single-cell selection to the OS clipboard.
deleteRowAt(int index) → void
deleteSelectedRow() → void
displayAt(int r, int c) String
The string shown in cell (r,c) — equals the stored value for most kinds, but resolves a ComputedColumn against the whole row.
dispose() → void
Discards any resources used by the object.
override
duplicateRowAt(int index) → void
duplicateSelectedRow() → void
hasWidthOverride(int visual) bool
Whether the column at visual currently has a drag-resize override.
insertRowAt(int index) → void
isSelected(int r, int c) bool
logicalColumnAt(int visual) int
The logical column index shown at visual position visual.
moveColumn(int fromVisual, int toVisual) → void
Move the column at visual position fromVisual to toVisual (header drag-and-drop). Only the visual order changes; logical indices — and so the selection, sort column and cell values — are untouched.
moveSelection(int dr, int dc) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
pasteCell() → void
redo() → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resetColumnWidth(int visual) → void
Drop the resize override for the column at visual (double-tap the handle).
resizeColumn(int visual, double delta, {double min = columnMinWidth, double max = columnMaxWidth}) → void
Resize the column at visual position visual by delta px, clamped to columnMinWidth..columnMaxWidth. Pass an RTL-mirrored delta from the view.
rowMap(int r) EditableRow
A copy of row r's data map (for row-aware validators / custom cells).
rowsAsTsv(Iterable<int> rowIndices, {bool includeHeader = false}) String
Whole rows (every column), in ascending row order.
select(int r, int c) → void
setRows(List<EditableRow> rows, {bool record = true}) → void
Replace all rows programmatically (e.g. load from a data source). Records one undo step by default.
sortByColumn(int ci) → void
Click a header: cycles asc → desc → asc; reorders rows (undoable).
tabNext({bool grow = true, bool backward = false}) → void
Tab to the next cell in reading order. When the cursor is on the very last cell (last row, last column) and grow is true, a fresh blank row is appended first and the cursor lands on its first cell — so Tab keeps flowing data entry without ever reaching for the mouse. Pass backward for Shift+Tab.
toString() String
A string representation of this object.
inherited
undo() → void
updateDraft(String value) → void
Live draft update from the editing field — intentionally does NOT notify (the field owns its own text); committed value lands via commit.
widthOf(int visual) double
The effective width of the column at visual position visual: a drag override if any, else the column's declared EditableColumn.width.
writeCell(int r, int c, String value) → void
Directly write a cell (used by clear, cut, paste) as one history step.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

columnMaxWidth → const double
columnMinWidth → const double
Min / max a column can be dragged to (px).