copyWith method
TableCellTheme
copyWith({
- ValueGetter<
WidgetStateProperty< ? border,Border> ?> - ValueGetter<
WidgetStateProperty< ? backgroundColor,Color> ?> - ValueGetter<
WidgetStateProperty< ? textStyle,TextStyle> ?>
Creates a copy of this cell theme with the given values replaced.
Returns a new TableCellTheme instance with the same state properties as this theme, except for any parameters that are explicitly provided. Use ValueGetter functions to specify new state properties.
Example:
final newTheme = originalTheme.copyWith(
backgroundColor: () => WidgetStateProperty.all(Colors.yellow.shade50),
textStyle: () => WidgetStateProperty.all(TextStyle(fontWeight: FontWeight.bold)),
);
Implementation
TableCellTheme copyWith({
ValueGetter<WidgetStateProperty<Border>?>? border,
ValueGetter<WidgetStateProperty<Color>?>? backgroundColor,
ValueGetter<WidgetStateProperty<TextStyle>?>? textStyle,
}) {
return TableCellTheme(
border: border == null ? this.border : border(),
backgroundColor:
backgroundColor == null ? this.backgroundColor : backgroundColor(),
textStyle: textStyle == null ? this.textStyle : textStyle(),
);
}