FondeTableView<T> class
A desktop-optimized table view component.
Supports column resizing, reordering, sorting, single/multi-row selection, row reordering, and accessibility zoom scaling.
Basic Usage
FondeTableView<MyItem>(
data: items,
columns: [
FondeTableColumn(
id: 'name',
title: 'Name',
width: 200,
cellBuilder: (item, isSelected) => FondeText(item.name, variant: FondeTextVariant.uiCaption),
),
],
keyExtractor: (item) => item.id,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FondeTableView
Constructors
-
FondeTableView({Key? key, required List<
T> data, required List<FondeTableColumn< columns, required String keyExtractor(T), void onRowsSelected(List<T> >T> )?, void onRowDoubleTap(T)?, bool allowMultiSelect = false, bool allowColumnReordering = true, bool allowColumnResizing = true, bool allowRowReordering = false, String? initialSortColumnId, FondeTableSortDirection initialSortDirection = FondeTableSortDirection.ascending, bool dimHeaders = true, bool highlightSortedHeader = true, Set<String> ? primaryColumnIds, bool highlightHeaderOnDrag = false, bool highlightRowOnHover = false, FondeTableRowReorderIndicator rowReorderIndicator = FondeTableRowReorderIndicator.line, FondeTableRowDragStyle rowDragStyle = FondeTableRowDragStyle.fullRow, bool showHeaderDivider = true, double headerDividerThickness = 2.0, FondeTableColumnStyle columnStyle = FondeTableColumnStyle.divider, Color? stripeColor, Widget headerLeadingBuilder()?, Widget rowLeadingBuilder(T item)?, Widget headerTrailingBuilder()?, Widget rowTrailingBuilder(T item)?, void onColumnReorder(int oldIndex, int newIndex)?, void onColumnResize(int index, double newWidth)?, void onRowReorder(int oldIndex, int newIndex)?, bool onRowReorderWillAccept(int draggedIndex, int targetIndex)?}) -
const
Properties
- allowColumnReordering → bool
-
Whether columns can be reordered by dragging.
final
- allowColumnResizing → bool
-
Whether columns can be resized.
final
- allowMultiSelect → bool
-
Whether multiple rows can be selected simultaneously.
final
- allowRowReordering → bool
-
Whether rows can be reordered by dragging.
final
-
columns
→ List<
FondeTableColumn< T> > -
Column definitions.
final
- columnStyle → FondeTableColumnStyle
-
Controls the column separator style.
Defaults to FondeTableColumnStyle.divider.
final
-
data
→ List<
T> -
Table data items.
final
- dimHeaders → bool
-
When true, header text and icons are shown at reduced opacity (dimmed).
Defaults to true.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerDividerThickness → double
-
Thickness of the header bottom divider in logical pixels.
Only meaningful when showHeaderDivider is true. Defaults to 2.0.
final
- headerLeadingBuilder → Widget Function()?
-
Builds a widget shown to the left of the header row.
The widget is not part of any column and sits outside the column area.
final
- headerTrailingBuilder → Widget Function()?
-
Builds a widget shown to the right of the header row.
final
- highlightHeaderOnDrag → bool
-
When true, the dragged column and its drop target are highlighted during
column reordering. Defaults to false.
final
- highlightRowOnHover → bool
-
When true, rows are highlighted when hovered. Defaults to false.
final
- highlightSortedHeader → bool
-
When true and a column is actively sorted, that column's header is shown
at full opacity while others remain dimmed. Only meaningful when
dimHeaders is true. Defaults to true.
final
- initialSortColumnId → String?
-
Column id to sort by on initial display. Requires the column to have
FondeTableColumn.sortable true and a FondeTableColumn.sortKeyBuilder.
final
- initialSortDirection → FondeTableSortDirection
-
Initial sort direction. Defaults to FondeTableSortDirection.ascending.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyExtractor → String Function(T)
-
Function to extract a unique string key from a data item.
final
- onColumnReorder → void Function(int oldIndex, int newIndex)?
-
Called when a column is reordered. Indices are into the current column order.
final
- onColumnResize → void Function(int index, double newWidth)?
-
Called when a column is resized. Index is into the current column order.
final
- onRowDoubleTap → void Function(T)?
-
Called when a row is double-tapped.
final
- onRowReorder → void Function(int oldIndex, int newIndex)?
-
Called when a row is reordered via drag.
final
- onRowReorderWillAccept → bool Function(int draggedIndex, int targetIndex)?
-
Called while a dragged row hovers over another row.
Return false to disallow dropping onto
targetIndex.final -
onRowsSelected
→ void Function(List<
T> )? -
Called when the row selection changes.
final
-
primaryColumnIds
→ Set<
String> ? -
Column ids whose cell content is shown at full opacity.
All other columns are dimmed.
final
- rowDragStyle → FondeTableRowDragStyle
-
Controls what is shown as the drag overlay during row reordering.
Defaults to FondeTableRowDragStyle.fullRow.
final
- rowLeadingBuilder → Widget Function(T item)?
-
Builds a widget shown to the left of each data row.
The widget is not part of any column and sits outside the column area.
final
- rowReorderIndicator → FondeTableRowReorderIndicator
-
Visual indicator style for the row insertion position during reordering.
Defaults to FondeTableRowReorderIndicator.line.
final
- rowTrailingBuilder → Widget Function(T item)?
-
Builds a widget shown to the right of each data row.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showHeaderDivider → bool
-
Controls whether a horizontal divider is shown below the header row.
Defaults to true.
final
- stripeColor → Color?
-
Background color for alternating rows when columnStyle is
FondeTableColumnStyle.stripe. When null, a subtle tint derived from
the theme's base background is used.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FondeTableView< T> > -
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