TreeDataTable class
A widget that displays hierarchical data in a table format with expandable rows, optional pagination, and a customizable header.
The TreeDataTable supports pinning the header, setting min/max extents for the header, and paginating the root-level rows. Each row can have child rows, which can be expanded or collapsed. The table header may contain grouped rows followed by one leaf-column HeaderRow.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TreeDataTable
Constructors
-
TreeDataTable.eager({Key? key, bool headerPinned = true, double headerMinExtent = 51, double headerMaxExtent = 51, required List<
HeaderRow> headerRows, required TreeDataTableEagerDataSource dataSource, String? persistColumnStateId, bool scaleColumnsToFit = false, TreeDataTableRowSelectionMode rowSelectionMode = TreeDataTableRowSelectionMode.none, Set<Object> ? selectedRowIds, Set<Object> initialSelectedRowIds = const <Object>{}, TreeDataTableRowSelectionChanged? onRowSelectionChanged, bool showSelectionCheckboxes = false, bool selectRowsOnTap = false, ValueChanged<TreeDataTableFilterState> ? onFilterChanged}) -
Creates a normal table from a typed eager
dataSource.const -
TreeDataTable.lazy({Key? key, bool headerPinned = true, double headerMinExtent = 51, double headerMaxExtent = 51, required List<
HeaderRow> headerRows, required TreeDataTableLazyDataSource dataSource, String? persistColumnStateId, bool scaleColumnsToFit = false, TreeDataTableRowSelectionMode rowSelectionMode = TreeDataTableRowSelectionMode.none, Set<Object> ? selectedRowIds, Set<Object> initialSelectedRowIds = const <Object>{}, TreeDataTableRowSelectionChanged? onRowSelectionChanged, bool showSelectionCheckboxes = false, bool selectRowsOnTap = false, ValueChanged<TreeDataTableFilterState> ? onFilterChanged}) -
Creates a table that requests only the currently selected root-row page.
const
Properties
- dataSource → TreeDataTableDataSource
-
Defines whether rows are supplied eagerly or loaded page by page.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerMaxExtent → double
-
The maximum extent (height) of the header.
final
- headerMinExtent → double
-
The minimum extent (height) of the header.
final
- headerPinned → bool
-
Whether the header should be pinned to the top.
final
-
headerRows
→ List<
HeaderRow> -
The header rows, from optional grouped rows to the leaf-column row.
final
-
initialSelectedRowIds
→ Set<
Object> -
Initial selected row IDs for uncontrolled selection.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onFilterChanged
→ ValueChanged<
TreeDataTableFilterState> ? -
Called after column or quick-filter state changes.
final
- onRowSelectionChanged → TreeDataTableRowSelectionChanged?
-
Called after row selection changes.
final
- persistColumnStateId → String?
-
Use a unique ID for each table instance if you need separate persistence per table.
If null, column state are not persisted.
final
- rowSelectionMode → TreeDataTableRowSelectionMode
-
Defines row selection behavior.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleColumnsToFit → bool
-
Whether flex columns should follow changes to the table width until the
user explicitly resizes them.
final
-
selectedRowIds
→ Set<
Object> ? -
Controlled set of selected row IDs.
final
- selectRowsOnTap → bool
-
Whether tapping a row toggles or replaces row selection.
final
- showSelectionCheckboxes → bool
-
Whether a leading checkbox should be shown for selectable rows.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< TreeDataTable> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited