ReadableTableController<T> class
Constructors
-
ReadableTableController({required List<ReadableColumn<T>> columns, List<T>? rows, ReadableSelectionMode selectionMode = ReadableSelectionMode.none, Set<int>? selectedRows, Set<ReadableCell>? selectedCells, int? sortColumn, bool sortAscending = true, List<ReadableFilter>? filters, ReadableFilterJoin filterJoin = ReadableFilterJoin.all, String query = '', Iterable<int>? quickSearchColumns, ReadableFilterGroup? filterGroup})
-
Methods
-
addFilter(ReadableFilter filter)
→ void
-
Append a filter predicate.
-
addListener(VoidCallback listener)
→ void
-
Register a closure to be called when the object changes.
inherited
-
addRow(T value)
→ void
-
Append
value as the last row.
-
addRowWhere(bool test(T value), T value, {bool after = true, bool firstOnly = true})
→ void
-
Insert
value adjacent to rows matching test — after the match by
default, or before it. With firstOnly (default) only the first match is
used; otherwise value is inserted next to every match.
-
cellText(int visibleRow, int col)
→ String
-
Plain-text value of the VISIBLE cell (row, col), via the column's
ReadableColumn.copyText → ReadableColumn.sortKey → toString chain.
-
clearColumnFilters()
→ void
-
Drop every inline column filter (keeps the structured filters + search).
-
clearFilters()
→ void
-
Drop every filter (flat list + nested tree + inline column filters) and
the quick-search.
-
clearSelection()
→ void
-
-
clearSort()
→ void
-
Clear the sort indicator (restores master order under the filter).
-
columnAt(int visual)
→ ReadableColumn<T>
-
The column shown at visual position
visual.
-
columnFilter(int ci)
→ ReadableFilter?
-
The inline filter active on logical column
ci, or null.
-
copySelectionAsTsv({})
→ String
-
Serialize the current selection to a TSV string (visible order):
• row modes → every column of each selected row
• cell modes → the bounding rectangle of the selected cells; cells
inside the rectangle but not selected are emitted as empty fields.
Returns '' when nothing is selected.
-
copySelectionToClipboard({})
→ Future<int>
-
Copy the current selection to the system clipboard as TSV. Returns the
number of rows written (0 ⇒ nothing selected).
-
deleteRowAt(int index)
→ void
-
Remove the row at visible
index.
-
deleteRowByValue(T value)
→ void
-
Remove the first master row whose value
== value.
-
deleteRowsWhere(bool test(T value))
→ int
-
Remove every row matching
test. Returns the number removed.
-
deleteSelectedRows()
→ void
-
Remove every currently-selected (visible) row.
-
dispose()
→ void
-
Discards any resources used by the object.
inherited
-
distinctValues(int ci)
→ List<String>
-
The distinct, sorted string values present in column
ci — feeds the
editor's is any of chips and is dropdown.
-
hasWidthOverride(int visual)
→ bool
-
Whether the column at
visual currently has a drag-resize override.
-
insertFilterAt(int index, ReadableFilter filter)
→ void
-
Insert a filter at
index.
-
insertRowAt(int index, T value)
→ void
-
Insert
value near visible index (clamped). With a filter active the
row lands next to the corresponding master row.
-
isCellSelected(int visibleRow, int col)
→ bool
-
-
isColumnFilterable(int ci)
→ bool
-
Whether a column can be filtered (we can read a value from it).
-
isRowSelected(int visibleIndex)
→ bool
-
-
logicalColumnAt(int visual)
→ int
-
The logical column index shown at visual position
visual.
-
moveActive(int dRow, int dCol, {bool extend = false})
→ void
-
-
moveActiveTo(int row, int col, {bool extend = false})
→ void
-
-
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 addresses — are untouched.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners()
→ void
-
Call all the registered listeners.
inherited
-
removeFilterAt(int index)
→ void
-
Remove the filter at
index.
-
removeListener(VoidCallback listener)
→ void
-
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
replaceFirstWhere(bool test(T value), T update(T value))
→ void
-
Replace only the first row matching
test with update(currentValue).
-
replaceRowAt(int index, T value)
→ void
-
Replace the visible row at
index with value.
-
replaceRowByValue(T oldValue, T newValue)
→ void
-
Replace the first master row equal to
oldValue with newValue.
-
replaceRowsWhere(bool test(T value), T update(T value))
→ int
-
Replace every row matching
test with update(currentValue). Returns
the number replaced.
-
resetColumnWidth(int visual)
→ void
-
Drop the resize override for the column at
visual (double-tap the handle
to restore its declared width / flex).
-
resizeColumn(int visual, double delta, {double min = columnMinWidth, double max = columnMaxWidth})
→ void
-
Resize the column at visual position
visual by delta px (drag), clamped
to columnMinWidth..columnMaxWidth. A flex column becomes fixed-width on
first resize. Pass an RTL-mirrored delta from the view.
-
rowAt(int index)
→ T
-
The visible row at
index.
-
selectAll()
→ void
-
-
selectAllCells()
→ void
-
-
selectAllRows()
→ void
-
Select all VISIBLE rows (multi-row) — no-op in other modes.
-
selectCellAt(int visibleRow, int col, {bool additive = false, bool range = false})
→ void
-
-
selectRowAt(int index, {bool additive = false, bool range = false})
→ void
-
Select the row at visible
index. additive toggles it within the
existing selection (multi only); range extends from the anchor.
-
selectRowByValue(T value, {bool additive = false})
→ void
-
Select the first visible row whose value
== value.
-
selectRowsWhere(bool test(T value), {bool additive = false})
→ void
-
Select every visible row matching
test. Replaces the selection unless
additive. In single-row mode only the last match survives.
-
setColumnFilter(int ci, ReadableFilter? filter)
→ void
-
Set (or clear) the inline filter on logical column
ci. Pass null, or a
filter that isn't ReadableFilter.isComplete, to clear it. Inline column
filters AND together and AND on top of the quick-search and the structured
filters, so the header row narrows whatever is already shown.
-
setColumnSearch(int ci, String text)
→ void
-
A convenience for the most common header filter: a case-insensitive
contains on column ci. Empty text clears it.
-
setFilterGroup(ReadableFilterGroup? group)
→ void
-
Set (or clear) the nested filter tree. When non-empty it supersedes the
flat filters list for structured filtering; the quick-search still
applies on top. Pass null or an empty group to clear it.
-
setFilterJoin(ReadableFilterJoin join)
→ void
-
Switch AND ⇄ OR for the filter list.
-
setFilters(List<ReadableFilter> filters)
→ void
-
Replace the whole filter list.
-
setQuery(String q)
→ void
-
Set the cross-column search string (empty clears it).
-
setRows(List<T> values)
→ void
-
Replace the entire row set (e.g. load from a data source). Clears the
selection; keeps the sort + filter applied.
-
setSelectionMode(ReadableSelectionMode mode)
→ void
-
-
sortByColumn(int ci)
→ void
-
Click a sortable header: cycles asc → desc. The view is rebuilt; the
selection (master space) follows its rows automatically.
-
toggleActive()
→ void
-
-
toggleFilterAt(int index, [bool? on])
→ void
-
Toggle (or set) a filter's enabled flag — keeps the chip, stops applying.
-
toString()
→ String
-
A string representation of this object.
inherited
-
updateFilterAt(int index, ReadableFilter filter)
→ void
-
Replace the filter at
index.
-
widthOf(int visual)
→ double?
-
The effective width of the column at visual position
visual: a drag
override if any, else the column's declared fixed ReadableColumn.width.
Returns null when the column should flex (no override, no fixed width).