copyWith method

ButtonStyle copyWith({
  1. WidgetStateProperty<TextStyle?>? textStyle,
  2. WidgetStateProperty<Color?>? backgroundColor,
  3. WidgetStateProperty<Color?>? foregroundColor,
  4. WidgetStateProperty<Color?>? overlayColor,
  5. WidgetStateProperty<Color?>? shadowColor,
  6. WidgetStateProperty<Color?>? surfaceTintColor,
  7. WidgetStateProperty<double?>? elevation,
  8. WidgetStateProperty<EdgeInsetsGeometry?>? padding,
  9. WidgetStateProperty<Size?>? minimumSize,
  10. WidgetStateProperty<Size?>? fixedSize,
  11. WidgetStateProperty<Size?>? maximumSize,
  12. WidgetStateProperty<Color?>? iconColor,
  13. WidgetStateProperty<double?>? iconSize,
  14. IconAlignment? iconAlignment,
  15. WidgetStateProperty<BorderSide?>? side,
  16. WidgetStateProperty<OutlinedBorder?>? shape,
  17. WidgetStateProperty<MouseCursor?>? mouseCursor,
  18. VisualDensity? visualDensity,
  19. MaterialTapTargetSize? tapTargetSize,
  20. Duration? animationDuration,
  21. bool? enableFeedback,
  22. AlignmentGeometry? alignment,
  23. InteractiveInkFeatureFactory? splashFactory,
  24. ButtonLayerBuilder? backgroundBuilder,
  25. ButtonLayerBuilder? foregroundBuilder,
})

Returns a copy of this ButtonStyle with the given fields replaced with the new values.

Implementation

ButtonStyle copyWith({
  WidgetStateProperty<TextStyle?>? textStyle,
  WidgetStateProperty<Color?>? backgroundColor,
  WidgetStateProperty<Color?>? foregroundColor,
  WidgetStateProperty<Color?>? overlayColor,
  WidgetStateProperty<Color?>? shadowColor,
  WidgetStateProperty<Color?>? surfaceTintColor,
  WidgetStateProperty<double?>? elevation,
  WidgetStateProperty<EdgeInsetsGeometry?>? padding,
  WidgetStateProperty<Size?>? minimumSize,
  WidgetStateProperty<Size?>? fixedSize,
  WidgetStateProperty<Size?>? maximumSize,
  WidgetStateProperty<Color?>? iconColor,
  WidgetStateProperty<double?>? iconSize,
  IconAlignment? iconAlignment,
  WidgetStateProperty<BorderSide?>? side,
  WidgetStateProperty<OutlinedBorder?>? shape,
  WidgetStateProperty<MouseCursor?>? mouseCursor,
  VisualDensity? visualDensity,
  MaterialTapTargetSize? tapTargetSize,
  Duration? animationDuration,
  bool? enableFeedback,
  AlignmentGeometry? alignment,
  InteractiveInkFeatureFactory? splashFactory,
  ButtonLayerBuilder? backgroundBuilder,
  ButtonLayerBuilder? foregroundBuilder,
}) {
  return ButtonStyle(
    textStyle: textStyle ?? this.textStyle,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    foregroundColor: foregroundColor ?? this.foregroundColor,
    overlayColor: overlayColor ?? this.overlayColor,
    shadowColor: shadowColor ?? this.shadowColor,
    surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
    elevation: elevation ?? this.elevation,
    padding: padding ?? this.padding,
    minimumSize: minimumSize ?? this.minimumSize,
    fixedSize: fixedSize ?? this.fixedSize,
    maximumSize: maximumSize ?? this.maximumSize,
    iconColor: iconColor ?? this.iconColor,
    iconSize: iconSize ?? this.iconSize,
    iconAlignment: iconAlignment ?? this.iconAlignment,
    side: side ?? this.side,
    shape: shape ?? this.shape,
    mouseCursor: mouseCursor ?? this.mouseCursor,
    visualDensity: visualDensity ?? this.visualDensity,
    tapTargetSize: tapTargetSize ?? this.tapTargetSize,
    animationDuration: animationDuration ?? this.animationDuration,
    enableFeedback: enableFeedback ?? this.enableFeedback,
    alignment: alignment ?? this.alignment,
    splashFactory: splashFactory ?? this.splashFactory,
    backgroundBuilder: backgroundBuilder ?? this.backgroundBuilder,
    foregroundBuilder: foregroundBuilder ?? this.foregroundBuilder,
  );
}