copyWith method

  1. @useResult
FButtonStyle copyWith({
  1. FWidgetStateMap<BoxDecoration>? decoration,
  2. FButtonContentStyle contentStyle(
    1. FButtonContentStyle
    )?,
  3. FButtonIconContentStyle iconContentStyle(
    1. FButtonIconContentStyle
    )?,
  4. FTappableStyle tappableStyle(
    1. FTappableStyle
    )?,
  5. FFocusedOutlineStyle focusedOutlineStyle(
    1. FFocusedOutlineStyle
    )?,
})

Returns a copy of this FButtonStyle with the given properties replaced.

Where possible, it is strongly recommended to use the CLI to generate a style and directly modify the style.

decoration

The box decoration.

Supported states:

contentStyle

The content's style.

iconContentStyle

The icon content's style.

tappableStyle

The tappable's style.

focusedOutlineStyle

The focused outline style.

Implementation

@useResult
FButtonStyle copyWith({
  FWidgetStateMap<BoxDecoration>? decoration,
  FButtonContentStyle Function(FButtonContentStyle)? contentStyle,
  FButtonIconContentStyle Function(FButtonIconContentStyle)? iconContentStyle,
  FTappableStyle Function(FTappableStyle)? tappableStyle,
  FFocusedOutlineStyle Function(FFocusedOutlineStyle)? focusedOutlineStyle,
}) => FButtonStyle(
  decoration: decoration ?? this.decoration,
  contentStyle: contentStyle != null ? contentStyle(this.contentStyle) : this.contentStyle,
  iconContentStyle: iconContentStyle != null ? iconContentStyle(this.iconContentStyle) : this.iconContentStyle,
  tappableStyle: tappableStyle != null ? tappableStyle(this.tappableStyle) : this.tappableStyle,
  focusedOutlineStyle: focusedOutlineStyle != null
      ? focusedOutlineStyle(this.focusedOutlineStyle)
      : this.focusedOutlineStyle,
);