TTableTheme class

Theme configuration for TTable.

TTableTheme extends TListTheme and aggregates sub-themes for:

It also defines layout properties like column width calculation logic and breakpoints for switching between card/table views.

Inheritance

Constructors

TTableTheme({TListAnimationBuilder? animationBuilder = TListAnimationBuilders.staggered, Duration animationDuration = const Duration(milliseconds: 800), bool? shrinkWrap = false, ScrollPhysics? physics, EdgeInsets? padding, required TListEmptyBuilder? emptyStateBuilder, required TListErrorBuilder? errorStateBuilder, TListLoadingBuilder? loadingBuilder, TListHeaderBuilder? headerBuilder, bool? headerSticky, TListFooterBuilder? footerBuilder, bool? footerSticky, bool? infiniteScroll, required TListFooterBuilder infiniteScrollFooterBuilder, TListSeparatorBuilder? listSeparatorBuilder, TListDragProxyDecorator? dragProxyDecorator, TGridMode? grid, TGridDelegateBuilder? gridDelegate, double? cardWidth, bool? forceCardStyle, bool? dense = false, double? expandSideListWidth, double? minSideExpandWidth, required TTableRowHeaderTheme headerTheme, required TTableMobileCardTheme mobileCardTheme, required TTableRowCardTheme rowCardTheme})
Creates a table theme.
const
TTableTheme.defaultTheme(ColorScheme colors)
Creates a default theme derived from the context colors.
factory

Properties

animationBuilder → TListAnimationBuilder?
finalinherited
animationDuration → Duration
finalinherited
cardWidth → double?
final
dense → bool?
final
dragProxyDecorator → TListDragProxyDecorator?
finalinherited
emptyStateBuilder → TListEmptyBuilder?
finalinherited
errorStateBuilder → TListErrorBuilder?
finalinherited
expandSideListWidth → double?
Width of the left side list when using TTableExpansionMode.side.
final
footerBuilder → TListEmptyBuilder?
finalinherited
footerSticky → bool?
finalinherited
forceCardStyle → bool?
final
grid → TGridMode?
finalinherited
gridDelegate → TGridDelegateBuilder?
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
headerBuilder → TListEmptyBuilder?
finalinherited
headerSticky → bool?
finalinherited
headerTheme → TTableRowHeaderTheme
final
infiniteScroll → bool?
finalinherited
infiniteScrollFooterBuilder → TListFooterBuilder
finalinherited
listSeparatorBuilder → TListSeparatorBuilder?
finalinherited
loadingBuilder → TListEmptyBuilder?
finalinherited
minSideExpandWidth → double?
Minimum width required to show the side list alongside the detail panel in TTableExpansionMode.side.
final
mobileCardTheme → TTableMobileCardTheme
final
padding → EdgeInsets?
finalinherited
physics → ScrollPhysics?
finalinherited
rowCardTheme → TTableRowCardTheme
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shrinkWrap → bool?
finalinherited

Methods

buildDefaultExpandedContent<T>(ColorScheme colors, T item, int index) → Widget
Builds a default simplified expanded content widget.
copyWith({TListAnimationBuilder? animationBuilder, Duration? animationDuration, bool? shrinkWrap, ScrollPhysics? physics, EdgeInsets? padding, TListEmptyBuilder? emptyStateBuilder, TListErrorBuilder? errorStateBuilder, TListLoadingBuilder? loadingBuilder, TListHeaderBuilder? headerBuilder, TListFooterBuilder? footerBuilder, bool? headerSticky, bool? footerSticky, bool? infiniteScroll, TListFooterBuilder? infiniteScrollFooterBuilder, TListSeparatorBuilder? listSeparatorBuilder, TListDragProxyDecorator? dragProxyDecorator, TGridMode? grid, TGridDelegateBuilder? gridDelegate, double? cardWidth, bool? forceCardStyle, bool? dense, double? expandSideListWidth, double? minSideExpandWidth, TTableRowHeaderTheme? headerTheme, TTableMobileCardTheme? mobileCardTheme, TTableRowCardTheme? rowCardTheme}) → TTableTheme
Creates a copy of the theme with updated properties.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

calculateColumnWidths<T, K>(List<TTableHeader<T, K>> headers, bool selectable, bool expandable, {int maxTreeLevel = 0, bool isHierarchical = false, List<T> sampleItems = const [], TextStyle? headerTextStyle, TextStyle? contentTextStyle, double availableWidth = double.infinity}) → Map<int, TableColumnWidth>
One-shot convenience wrapper around measureColumns + TTableColumnMeasurements.resolve for callers that don't need to cache the measurement step themselves.
calculateTotalRequiredWidth<T, K>(List<TTableHeader<T, K>> headers, bool selectable, bool expandable, {int maxTreeLevel = 0, bool isHierarchical = false, List<T> sampleItems = const [], TextStyle? headerTextStyle, TextStyle? contentTextStyle}) → double
Calculates the minimum total width required for the table view (used to decide table-vs-card layout). Shares the exact same measurement as calculateColumnWidths so the two can never disagree.
measureColumns<T, K>(List<TTableHeader<T, K>> headers, bool selectable, bool expandable, {int maxTreeLevel = 0, bool isHierarchical = false, List<T> sampleItems = const [], TextStyle? headerTextStyle, TextStyle? contentTextStyle}) → TTableColumnMeasurements
Measures every column once (the expensive, text-layout part) and splits the result into fixed columns (selectable/expandable slots, and any header with an explicit TTableHeader.minWidth/maxWidth — those are honored exactly as given, no auto-sizing applied) versus auto columns that still need their natural width turned into a final pixel width once the available table width is known.
measureTextWidth(String text, [TextStyle style = fallbackTextStyle]) → double
Measures the width of a text string using TextPainter.

Constants

fallbackTextStyle → const TextStyle
horizontalChrome → const double
Padding/margin overhead outside the Table itself (row card padding, margins, etc.) subtracted from the widget's available width before it's divided between columns. A single named constant so this always agrees with TTableColumnMeasurements.requiredWidth — if the two disagreed, the table-vs-card breakpoint could pass while columns still didn't actually fit.