EditableTableController<T> class

Inheritance

Constructors

EditableTableController({required List<EditableColumn<T>> columns, required List<T> rows, T newRow()?, EditableSelectionMode selectionMode = EditableSelectionMode.none})

Properties

canRedo bool
no setter
canUndo bool
no setter
colCount int
no setter
columnOrder List<int>
no setter
columns List<EditableColumn<T>>
final
draft String
no setter
editing bool
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasSelection bool
no setter
newRow → T Function()?
Factory for a blank row (enables Add-row / Tab-to-grow). Optional.
final
rowCount int
no setter
rows List<T>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedCells Set<CellRef>
no setter
selectedCount int
no setter
selectedRowIndices Set<int>
no setter
selectedRows List<T>
no setter
selection CellRef
no setter
selectionEnabled bool
no setter
selectionIsCellMode bool
no setter
selectionIsMulti bool
no setter
selectionIsRowMode bool
no setter
selectionMode EditableSelectionMode
What clicks / keyboard selection do. Mutable so a host can flip mode at runtime (e.g. a segmented control).
getter/setter pair
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([T? row]) → void
beginEdit({String? initial}) → void
cancelEdit() → void
cellsAsTsv(Iterable<CellRef> cells) String
cellText(int r, int c) String
Display string for cell (row, LOGICAL col).
clearCell(int r, int c) → void
clearSelection() → void
clearSort() → void
columnAt(int visual) EditableColumn<T>
columnTotal(EditableColumn<T> col) double
commitEdit({String? valueOverride, int moveDr = 0, int moveDc = 0, bool grow = false}) → void
Commit the draft (or valueOverride) to the active cell and optionally move the cursor. One undoable step.
copyCellsToClipboard(Iterable<CellRef> cells) Future<bool>
copyRowsToClipboard(Iterable<int> rowIndices, {bool includeHeader = false}) Future<int>
copySelectionToClipboard() Future<void>
Copy the current selection (cursor cell when nothing is selected).
copySelectionTsvToClipboard({bool includeHeader = false}) Future<int>
Copy the current selection (or the active cell) to the clipboard as TSV. Returns the number of lines written.
deleteRowAt(int index) → void
deleteSelectedRow() → void
deleteSelectedRows() → void
Delete every selected row (row modes) as one undoable step.
dispose() → void
Discards any resources used by the object.
inherited
duplicateRowAt(int index) → void
duplicateSelectedRow() → void
hasWidthOverride(int visual) bool
insertRowAt(int index, [T? row]) → void
isCellInSelection(int r, int c) bool
isRowInSelection(int r) bool
isSelected(int r, int c) bool
logicalColumnAt(int visual) int
moveColumn(int fromVisual, int toVisual) → void
moveSelection(int dr, int dc, {bool grow = false}) → void
Move the cursor by (dr, dc). When grow and the move runs off the last row, a new blank row is appended (needs newRow).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
redo() → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
replaceRowAt(int r, T row) → void
resetColumnWidth(int visual) → void
resizeColumn(int visual, double delta, {double min = columnMinWidth, double max = columnMaxWidth}) → void
rowAt(int r) → T
rowsAsTsv(Iterable<int> rowIndices, {bool includeHeader = false}) String
select(int r, int c) → void
selectActive({bool additive = false, bool range = false}) → void
Re-apply the selection at the cursor cell — keyboard nav uses this so the highlight follows the active cell (range extends from the anchor).
selectAll() → void
Select everything (multi modes only).
selectCell(int row, int col, {bool additive = false, bool range = false}) → void
Select the cell at (row, col). additive toggles it (multi), range extends a rectangle from the anchor. Also moves the editing cursor.
selectionAsTsv({bool includeHeader = false}) String
Serialize the current SELECTION (rows or a cell rectangle, per mode) to TSV; falls back to the active cursor cell when nothing is selected.
selectRow(int index, {bool additive = false, bool range = false}) → void
Select the row at index. additive toggles it (multi), range extends from the anchor to index. Also moves the editing cursor onto the row.
setDraft(String v) → void
setRows(List<T> rows, {bool record = true}) → void
setSelectionMode(EditableSelectionMode mode) → void
Swap the selection mode at runtime; clears any existing selection.
sortByColumn(int ci) → void
toggleCheckbox(int r, int c) → void
Toggle a checkbox cell (boolean column) at (r, c). One undoable step.
toString() String
A string representation of this object.
inherited
undo() → void
widthOf(int visual) double
writeCell(int r, int c, String raw) → void

Operators

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

Static Methods

of<R>(BuildContext context) EditableTableController<R>?
truthy(String v) bool
Whether a string cell value reads as boolean-true.

Constants

columnMaxWidth → const double
columnMinWidth → const double