TreeDataTableProvider class
Provides state and logic for managing a tree-structured data table
- Inheritance
-
- Object
- ChangeNotifier
- TreeDataTableProvider
Constructors
Properties
-
buildedDataRows
↔ List<
TreeRow> -
Stores the built data rows for the tree table.
getter/setter pair
-
buildedHeaderRows
↔ List<
HeaderRow> -
Stores the built header rows for the tree table.
getter/setter pair
- childrenLoader ↔ TreeDataTableChildrenLoader?
-
Optional callback for loading children that were omitted from a root page.
getter/setter pair
-
columnOrderNotifier
→ ValueNotifier<
int> -
finalinherited
-
currentPageNotifier
→ ValueNotifier<
int> -
finalinherited
- expansionChangeNotifier → ChangeNotifier
-
Notifies listeners when the expansion state of any tree node changes.
trigger UI updates or other logic whenever a node in the tree is
expanded or collapsed.
final
- filterState → TreeDataTableFilterState
-
Current filter state, keyed by source leaf-column index.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hasRowSelection → bool
-
Whether row selection is enabled.
no setter
- isSyncingScroll ↔ bool
-
getter/setter pairinherited
- maxLevel ↔ int
-
Maximum level of the tree structure.
getter/setter pair
- onFilterChanged ↔ VoidCallback?
-
Called after column or quick-filter state changes.
getter/setter pair
- onSortChanged ↔ VoidCallback?
-
Called after the active sort column or direction changes.
getter/setter pair
- pageController ↔ PageController
-
getter/setter pairinherited
- pageItemCount → int
-
no setterinherited
- queryChildrenLoader ↔ TreeDataTableChildQueryLoader?
-
Optional query-aware callback for loading omitted children.
getter/setter pair
-
rowFilter
↔ List<
TreeRowNode> Function(List<TreeRowNode> rows)? -
Returns a filtered copy of a sibling list when filtering is active.
getter/setter pair
- rowSelectionMode ↔ TreeDataTableRowSelectionMode
-
Current row selection mode.
getter/setter pair
-
rowSorter
↔ List<
TreeRowNode> Function(List<TreeRowNode> rows)? -
Returns a sorted copy of a sibling list when sorting is active.
getter/setter pair
-
rowsPerPage
↔ List<
int> ? -
getter/setter pairinherited
-
rowsPerPageIndexNotifier
→ ValueNotifier<
int?> -
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scrollControllersHorizontal
→ Map<
Object, ScrollController> -
finalinherited
- scrollControllerVertical ↔ ScrollController?
-
getter/setter pairinherited
-
selectedRowIds
→ Set<
Object> -
Current selected row IDs.
no setter
-
selectedRowIdsNotifier
→ ValueNotifier<
Set< Object> > -
Notifies row widgets when the selected row IDs change.
final
-
getter/setter pairinherited
- showSelectionCheckboxes ↔ bool
-
Whether selectable rows render a leading checkbox in the tree column.
getter/setter pair
- sortColumnIndex → int?
-
The active leaf-column index, or null when the table is unsorted.
no setter
- sortDirection → TreeDataTableSortDirection?
-
The active direction, or null when the table is unsorted.
no setter
-
treeRowNodesPagesNotifier
→ ValueNotifier<
List< List< ?>TreeRowNode> > -
finalinherited
-
visibleColumnsNotifier
→ ValueNotifier<
bool> -
finalinherited
- visibleRowsSelectionValue → bool?
-
Select-all checkbox state for currently visible selectable rows.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
applyPersistedColumnState(
{String? tableId}) → void -
inherited
-
buildDataColumns(
List< TreeRowNode> treeNodes, int rowIndex, List<HeaderRow> headerRowList, {int level = 0, List<int> parentIndexes = const []}) → TreeRow? -
Builds data columns for the given
treeNodes,rowIndex, andheaderRowList. -
buildHeaderColumns(
List< HeaderRow> headerRows, int rowIndex, {double? parentMaxWidth, Map<int, double> widthOverrides = const <int, double>{}}) → HeaderRow -
Builds header columns for the given
headerRowsandrowIndex.parentMaxWidthis the available width for the header row. -
calculateMaxLevel(
List< TreeRowNode> treeRowNodes, {int level = 0}) → void - Calculates the maximum depth (level) of the tree structure.
-
canReorderHeaderColumn(
{required int rowIndex, required int columnIndex, required int targetLogicalColumnIndex}) → bool -
inherited
-
cleanupScrollControllers(
Set< Object> ? preservedKeys) → void -
inherited
-
clearAllFilters(
) → void - Clears all column filters and quick-filter text.
-
clearColumnFilter(
int columnIndex) → void - Clears the filter for a displayed leaf column.
-
collectRowKeys(
List< TreeRow> rows, Set<Object> keys) → void - Recursively collects unique row keys.
-
configureLazyPagination(
{required int totalRowCount, required int pageSize, required int currentPage}) → void -
Configures page metadata without retaining or splitting all root rows.
inherited
-
configureRowSelection(
{required TreeDataTableRowSelectionMode mode, Set< Object> ? selectedRowIds, Set<Object> initialSelectedRowIds = const <Object>{}, TreeDataTableRowSelectionChanged? onSelectionChanged, bool showCheckboxes = false, bool selectRowsOnTap = false, bool initializeUncontrolledSelection = false}) → void - Configures row selection, supporting both controlled and uncontrolled use.
-
createTreeRowNodesPages(
List< TreeRowNode> treeRowNodes) → void -
Paginates the root nodes using the selected page size.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
override
-
disposeScrollControllers(
) → void -
inherited
-
disposeTreeRowColumn(
) → void -
inherited
-
distinctFilterValues(
int columnIndex) → List< Object?> - Returns distinct filter values for a displayed leaf column.
-
filterActiveNotifier(
int columnIndex) → ValueNotifier< bool> -
Returns a listenable that is true when
columnIndexhas an active filter. -
findHeaderColumnIndex(
List< HeaderRow> headerRows, int rowIndex, int logicalColumnIndex) → int -
inherited
-
flattenedVisibleRows(
) → List< TreeRow> - Returns the currently visible rows in display order.
-
getScrollControllerForRowHorizontal(
Object uniqueKey, {int? level}) → ScrollController -
inherited
-
getScrollControllerForRowVertical(
) → ScrollController -
inherited
-
handleCellDoubleTap(
TreeRow row, int columnIndex) → void - Emits a public cell double-tap callback.
-
handleCellHover(
TreeRow row, int columnIndex) → void - Emits a public cell hover callback.
-
handleCellSecondaryTap(
TreeRow row, int columnIndex) → void - Emits a public cell secondary-tap callback.
-
handleCellTap(
TreeRow row, int columnIndex) → void - Emits a public cell tap callback.
-
handleHeaderColumnOrderChanged(
) → void - Refreshes display-index state after columns are reordered.
-
handleRowDoubleTap(
TreeRow row) → void - Emits a public row double-tap callback.
-
handleRowSecondaryTap(
TreeRow row) → void - Emits a public row secondary-tap callback.
-
handleRowTap(
TreeRow row) → void - Emits a public row tap callback.
-
hasCellCallbacks(
TreeRow row, int columnIndex) → bool -
Whether at least one cell interaction callback is configured for
rowandcolumnIndex. -
hasCellDoubleTapCallback(
TreeRow row, int columnIndex) → bool -
Whether a cell double-tap callback is configured for
rowandcolumnIndex. -
hasCellSecondaryTapCallback(
TreeRow row, int columnIndex) → bool -
Whether a cell secondary-tap callback is configured for
rowandcolumnIndex. -
hasCellTapCallback(
TreeRow row, int columnIndex) → bool -
Whether a cell tap callback is configured for
rowandcolumnIndex. -
hasRowCallbacks(
TreeRow row) → bool -
Whether at least one row interaction callback is configured for
row. -
hasRowDoubleTapCallback(
TreeRow row) → bool -
Whether a row double-tap callback is configured for
row. -
hasRowSecondaryTapCallback(
TreeRow row) → bool -
Whether a row secondary-tap callback is configured for
row. -
hasRowTapCallback(
TreeRow row) → bool -
Whether a row tap callback is configured for
row. -
invalidateLazyChildCache(
) → void - Clears cached lazy child rows so they are requested again later.
-
isColumnUserResized(
int columnIndex) → bool - Whether the user has explicitly selected this column's width.
-
isRowSelectable(
TreeRow row) → bool -
Whether
rowmay be selected by user interaction. -
isRowSelected(
TreeRow row) → bool -
Whether
rowis selected. -
loadTreeRowChildren(
TreeRow treeRow, List< HeaderRow> headerRowList, {int level = 0, List<int> parentIndexes = const []}) → void - Loads the children of a TreeRow lazily when it's expanded
-
markColumnUserResized(
int columnIndex) → void - Records that a column width was explicitly selected by the user.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onScroll(
ScrollController changedController) → void -
inherited
-
pageControllerAddListener(
) → void -
Adds a listener that keeps
currentPageNotifieraligned with the page.inherited -
rebuildHeaderRows(
List< HeaderRow> headerRows, {double? parentMaxWidth, bool scaleColumnsToFit = false}) → void - Rebuilds header rows while reusing existing header column state.
-
reconcileDataRows(
List< TreeRowNode> dataNodes, List<HeaderRow> headerRowList, {int pageStartIndex = 0}) → void - Rebuilds data rows while reusing existing TreeRow instances for unchanged row keys.
-
releaseScrollControllerForRowHorizontal(
Object uniqueKey, ScrollController controller) → void -
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reorderHeaderColumn(
{required int rowIndex, required int columnIndex, required int targetLogicalColumnIndex}) → bool - Captures sort state before columns are reordered.
-
saveColumnState(
{String? tableId}) → void -
Saves the current leaf-column state when persistence is enabled.
inherited
-
selectRow(
TreeRow row, {bool? selected, bool shiftPressed = false}) → void -
Toggles, selects, or clears selection for
row. -
selectRowFromContentTap(
TreeRow row) → void - Applies row selection for a tap on row content, when enabled.
-
setColumnFilter(
int columnIndex, TreeDataTableColumnFilter? filter) → void - Sets or clears the filter for a displayed leaf column.
-
setColumnPinned(
int logicalColumnIndex, {required bool pinLeft, required bool pinRight}) → void -
Pins or unpins a single leaf column.
inherited
-
setColumnVisibility(
int logicalColumnIndex, bool visible) → void -
Sets a leaf column's visibility and updates every grouped header above it.
inherited
-
setQuickFilter(
String? text) → void - Sets the active quick filter text.
-
setSortDirection(
int columnIndex, TreeDataTableSortDirection? direction) → void - Sets one leaf column as the active sort, clearing all other indicators.
-
setVisibleRowsSelected(
bool selected) → void - Selects or clears all currently visible selectable rows.
-
showColumnVisibilityDialog(
BuildContext context, List< HeaderColumn> headerColumns, TreeDataTableProvider provider, ValueChanged<List< onChanged, {String? tableId}) → voidHeaderColumn> > -
inherited
-
sourceColumnIndexForDisplay(
int columnIndex) → int - Returns the original data-column index for a displayed leaf column.
-
synchronizeGroupedHeaderPinning(
) → void -
Makes every grouped header reflect the pin state of its covered leaves.
inherited
-
synchronizeGroupedHeaderVisibility(
) → void -
Makes grouped headers visible whenever at least one covered leaf is visible.
inherited
-
syncScrollAfterRebuild(
) → void -
inherited
-
toggleSortDirection(
int columnIndex) → void - Cycles a sortable column through ascending, descending, and unsorted.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateDataColumnsVisibility(
bool visible, int columnIndex) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited