TableCellTheme class
Theme configuration for individual table cells.
TableCellTheme provides state-aware styling options for table cells using WidgetStateProperty to handle different interactive states like hover, selected, disabled, etc. This enables rich visual feedback for table interactions.
State-Aware Properties
All properties use WidgetStateProperty to support different visual states:
- WidgetState.hovered: Mouse hover state
- WidgetState.selected: Cell/row selection state
- WidgetState.disabled: Disabled interaction state
- WidgetState.pressed: Active press state
Example:
TableCellTheme(
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return Colors.blue.shade50;
}
return null;
}),
textStyle: WidgetStateProperty.all(
TextStyle(fontWeight: FontWeight.w500),
),
);
Constructors
-
TableCellTheme.new({WidgetStateProperty<
Border?> ? border, WidgetStateProperty<Color?> ? backgroundColor, WidgetStateProperty<TextStyle?> ? textStyle}) -
Creates a TableCellTheme.
const
Properties
-
backgroundColor
→ WidgetStateProperty<
Color?> ? -
State-aware background color for table cells.
final
-
border
→ WidgetStateProperty<
Border?> ? -
State-aware border configuration for table cells.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
textStyle
→ WidgetStateProperty<
TextStyle?> ? -
State-aware text styling for table cell content.
final
Methods
-
copyWith(
{ValueGetter< WidgetStateProperty< ? border, ValueGetter<Border> ?>WidgetStateProperty< ? backgroundColor, ValueGetter<Color> ?>WidgetStateProperty< ? textStyle}) → TableCellThemeTextStyle> ?> - Creates a copy of this cell theme with the given values replaced.
-
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.
override