copyWith method

TabsTheme copyWith({
  1. ValueGetter<EdgeInsetsGeometry?>? containerPadding,
  2. ValueGetter<EdgeInsetsGeometry?>? tabPadding,
  3. ValueGetter<Color?>? backgroundColor,
  4. ValueGetter<BorderRadiusGeometry?>? borderRadius,
})

Creates a copy of this theme with optionally replaced values.

Uses ValueGetter functions to allow nullable value replacement. Properties not provided retain their current values.

Parameters:

  • containerPadding: Optional getter for new container padding
  • tabPadding: Optional getter for new tab padding
  • backgroundColor: Optional getter for new background color
  • borderRadius: Optional getter for new border radius

Returns a new TabsTheme with updated values.

Implementation

TabsTheme copyWith({
  ValueGetter<EdgeInsetsGeometry?>? containerPadding,
  ValueGetter<EdgeInsetsGeometry?>? tabPadding,
  ValueGetter<Color?>? backgroundColor,
  ValueGetter<BorderRadiusGeometry?>? borderRadius,
}) {
  return TabsTheme(
    containerPadding:
        containerPadding == null ? this.containerPadding : containerPadding(),
    tabPadding: tabPadding == null ? this.tabPadding : tabPadding(),
    backgroundColor:
        backgroundColor == null ? this.backgroundColor : backgroundColor(),
    borderRadius: borderRadius == null ? this.borderRadius : borderRadius(),
  );
}